public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Sriraman Tallam <tmsriram@google.com>
To: Alan Modra <amodra@gmail.com>, binutils <binutils@sourceware.org>,
		Ian Lance Taylor <iant@google.com>
Subject: ICF on PowerPC Bug
Date: Tue, 01 Apr 2014 22:06:00 -0000	[thread overview]
Message-ID: <CAAs8Hmwt-YWeOGNjOoBhLEbCnRMFsyDnpHYTJtYvioYCM3_b1Q@mail.gmail.com> (raw)

Hi,


This program fails with ICF on powerpc:

__attribute__((noinline))
int foo () { return 1; }

__attribute__((noinline))
int bar () { return 0; }

__attribute__((noinline))
int fold1() {
  return foo ();
}

__attribute__((noinline))
int fold2() {
  return bar();
}

int main()
{
  assert (fold1() != fold2());
}

because fold2 is folded onto fold1.    The only way to differentiate
fold1 and fold2 which have the same object code is via the relocation
type and the Info value is different.  However, with powerpc this is
rewritten here in icf.cc:

// Look through function descriptors
parameters->target().function_location(&loc);
 if (loc.shndx != it_v->second)
{
 it_v->second = loc.shndx;
 // Modify symvalue/addend to the code entry.
 it_a->first = loc.offset;
 it_a->second = 0;
}

I am not sure how to fix it.

Thanks
Sri

             reply	other threads:[~2014-04-01 22:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-01 22:06 Sriraman Tallam [this message]
2014-04-02  6:54 ` Alan Modra
2014-04-02 16:49   ` Sriraman Tallam
2014-04-02 19:11     ` Sriraman Tallam
2014-04-02 21:12       ` Cary Coutant
2014-04-03  0:11         ` Sriraman Tallam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAs8Hmwt-YWeOGNjOoBhLEbCnRMFsyDnpHYTJtYvioYCM3_b1Q@mail.gmail.com \
    --to=tmsriram@google.com \
    --cc=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=iant@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).