public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* ICF on PowerPC Bug
@ 2014-04-01 22:06 Sriraman Tallam
  2014-04-02  6:54 ` Alan Modra
  0 siblings, 1 reply; 6+ messages in thread
From: Sriraman Tallam @ 2014-04-01 22:06 UTC (permalink / raw)
  To: Alan Modra, binutils, Ian Lance Taylor

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-04-03  0:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-01 22:06 ICF on PowerPC Bug Sriraman Tallam
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

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).