bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: ICF on PowerPC Bug


From: Sriraman Tallam
Subject: Fwd: ICF on PowerPC Bug
Date: Tue, 1 Apr 2014 15:07:37 -0700

---------- Forwarded message ----------
From: Sriraman Tallam <address@hidden>
Date: Tue, Apr 1, 2014 at 3:06 PM
Subject: ICF on PowerPC Bug
To: Alan Modra <address@hidden>, binutils <address@hidden>,
Ian Lance Taylor <address@hidden>


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 via email to

[Prev in Thread] Current Thread [Next in Thread]