OSDN Git Service

authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 17 Aug 1998 20:11:06 +0000 (20:11 +0000)
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 17 Aug 1998 20:11:06 +0000 (20:11 +0000)
        * 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@21808 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/config/rs6000/rs6000.c

index cb40c18..c1a2cea 100644 (file)
@@ -2187,6 +2187,16 @@ secondary_reload_class (class, mode, in)
   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