This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH 1/2] rs6000: Another PIC LRA fix
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: gcc-patches at gcc dot gnu dot org
- Cc: dje dot gcc at gmail dot com, Segher Boessenkool <segher at kernel dot crashing dot org>
- Date: Sat, 31 Oct 2015 17:39:48 +0000
- Subject: [PATCH 1/2] rs6000: Another PIC LRA fix
- Authentication-results: sourceware.org; auth=none
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.
---
gcc/config/rs6000/rs6000.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
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
--
1.9.3