This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Bug in egcs-1.1 (reduced testcase included)(PPC)



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]