This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Bug in egcs-1.1 (reduced testcase included)(PPC)
- To: David Edelsohn <dje at watson dot ibm dot com>
- Subject: Re: Bug in egcs-1.1 (reduced testcase included)(PPC)
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Mon, 17 Aug 1998 21:08:39 -0600
- cc: Franz Sirl <Franz dot Sirl-kernel at lauterbach dot com>, egcs-patches at cygnus dot com, Michael Meissner <meissner at cygnus dot com>, Hartmut Koptein <koptein at et-inf dot fho-emden dot de>
- Reply-To: law at cygnus dot com
Here's the patch I checked in to fix this problem.
* rs6000.c (secondary_reload_class): For TARGET_ELF, indicate that
a BASE_REGS register is needed as an intermediate when copying
a symbolic value into any register class other than BASE_REGS.
Index: rs6000.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.27.2.4
diff -c -3 -p -r1.27.2.4 rs6000.c
*** rs6000.c 1998/08/08 18:21:15 1.27.2.4
--- rs6000.c 1998/08/18 03:06:20
*************** secondary_reload_class (class, mode, in)
*** 2187,2192 ****
--- 2187,2202 ----
if (regno >= FIRST_PSEUDO_REGISTER)
regno = -1;
+ /* We can not copy a symbolic operand directly into anyting other than
+ BASE_REGS for TARGET_ELF. So indicate that a register from BASE_REGS
+ is needed as an intermediate register. */
+ if (TARGET_ELF
+ && class != BASE_REGS
+ && (GET_CODE (in) == SYMBOL_REF
+ || GET_CODE (in) == LABEL_REF
+ || GET_CODE (in) == CONST))
+ return BASE_REGS;
+
/* We can place anything into GENERAL_REGS and can put GENERAL_REGS
into anything. */
if (class == GENERAL_REGS || class == BASE_REGS