Message ID | 7e54882ef262803dd1d2b9c36f1ecdaa5220edea.1446312596.git.segher@kernel.crashing.org |
---|---|
State | New |
Headers | show |
On Sat, Oct 31, 2015 at 1:39 PM, Segher Boessenkool <segher@kernel.crashing.org> wrote: > This one for TARGET_TOC && TARGET_MINIMAL_TOC. Without it, r30 is not > saved in the prologue for functions that do not use r30, but the register > is set later in the prologue anyhow. This made all java tests fail. > > Tested on powerpc64-linux, --enable-languages=all,ada,go,obj-c++ and test > variants {-m32/-mno-lra,-m32/-mlra,-m32/-mpowerpc64,-m64/-mno-lra,-m64/-mlra}; > and on powerpc64le-linux, everything default. Both also with bootstrapping > with LRA defaulted on. > > Okay for trunk? > > > Segher > > > 2015-10-31 Segher Boessenkool <segher@kernel.crashing.org> > > * config/rs6000/rs6000.c (rs6000_reg_live_or_pic_offset_p): Use the > same condition for testing whether RS6000_PIC_OFFSET_TABLE_REGNUM is > live as for using it elsewhere, for TARGET_MINIMAL_TOC. Okay. Thanks, David
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 9610625..1c55244 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -21793,7 +21793,9 @@ rs6000_reg_live_or_pic_offset_p (int reg) || (reg == RS6000_PIC_OFFSET_TABLE_REGNUM && !TARGET_SINGLE_PIC_BASE && ((DEFAULT_ABI == ABI_V4 && flag_pic != 0) - || (DEFAULT_ABI == ABI_DARWIN && flag_pic)))); + || (DEFAULT_ABI == ABI_DARWIN && flag_pic) + || (TARGET_TOC && TARGET_MINIMAL_TOC + && get_pool_size () != 0)))); } /* Return the first fixed-point register that is required to be