On Thu, Oct 29, 2015 at 12:52 PM, Segher Boessenkool <seg...@kernel.crashing.org> wrote: > The PIC reg (r30) needs to be saved whenever the prologue sets it up, > not just if it is used elsewhere in the function. Without this patch > the prologue for such a function will modify r30 without saving it > first, leading to disaster back in its callers. This happened in the > testsuite for -m32 libgfortran and libstdc++, bootstrapped with -mlra, > many hundred times. > > Tested on powerpc64-linux, with LRA enabled by default (so that the > target libraries are built with -mlra, the case that failed before > this patch), > {-m32/-mlra,-m32/-mno-lra,-m32/-mpowerpc64,-m64/-mlra,-m64/-mno-lra}. > With this and the previous LRA patch there now are no differences > between -mlra and -mno-lra testsuite runs (on big-endian power7, gcc110). > > Is this okay for trunk? > > > Segher > > > 2015-10-29 Segher Boessenkool <seg...@kernel.crashing.org> > > * config/rs6000/rs6000.c (rs6000_reg_live_or_pic_offset_p): Move this > function earlier in the file. > (first_reg_to_save): Use rs6000_reg_live_or_pic_offset_p instead of > df_regs_ever_live_p.
Good catch! Thanks, David