This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

ICF on PowerPC Bug


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]