On Fri, Jan 16, 2015 at 08:12:27PM +1030, Alan Modra wrote: > https://lists.ozlabs.org/pipermail/linuxppc-dev/2014-December/123776.html > shows gcc-5 miscompiling a powerpc64 linux kernel. The executive > summary is that the rs6000 backend has a bug in its RTL description of > indirect calls. We specify a parallel containing both the actual call > and an action that happens after the call, the restore of r2. The > restore is simply a memory load: > (set (reg:DI 2 2) > (mem/v/c:DI (plus:DI (reg/f:DI 1 1) > (const_int 40 [0x28])) [0 S8 A8])) > This leads to cprop concluding that it is valid to replace the > reference to r1 with another register having the same value before the > call. Unfortunately, sometimes a call-clobbered register is chosen. > > OK, so we need to fix this in the rs6000 backend, but it occurs to me > that cprop also has a bug here. It shouldn't be touching fixed hard > registers.
Why not? It cannot allocate a fixed reg to a pseudo, but other than that there is nothing special about fixed regs; the transform is perfectly valid as far as I see. It isn't a desirable transform in this case, but that is not true for fixed regs in general (just because the stack pointer is live everywhere). Segher