alias.c (find_base_value): Only return the known base value for pseudo registers.
authorJeffrey A Law <law@cygnus.com>
Wed, 5 Nov 1997 21:24:45 +0000 (21:24 +0000)
committerJeff Law <law@gcc.gnu.org>
Wed, 5 Nov 1997 21:24:45 +0000 (14:24 -0700)
        * alias.c (find_base_value): Only return the known base value for
        pseudo registers.

From-SVN: r16345

gcc/ChangeLog
gcc/alias.c

index 2801ba2280dee66ff32f840128b2aa6113500f55..4ed25d50079bf76580ddd2cdd62db72828c57680 100644 (file)
@@ -1,3 +1,8 @@
+Wed Nov  5 14:26:05 1997  Jeffrey A Law  (law@cygnus.com)
+
+       * alias.c (find_base_value): Only return the known base value for
+       pseudo registers.
+
 Wed Nov  5 11:27:14 1997  Jim Wilson  <wilson@cygnus.com>
 
        * i386.c (load_pic_register): Call prologue_get_pc_and_set_got.
index 0943444185a2c3b00cbc93fa4d486dc38879af40..025da501a427ff9730e9ddd5f88f23feea46f596 100644 (file)
@@ -102,10 +102,14 @@ find_base_value (src)
       if (REGNO (src) < FIRST_PSEUDO_REGISTER && copying_arguments)
        return new_reg_base_value[REGNO (src)];
 
-      /* If this REG is related to a known base value, return it.
-        This must happen after the arg register check above to avoid
-        circular set chains.  */
-      if (reg_base_value[REGNO (src)])
+      /* If a pseudo has a known base value, return it.  Do not do this
+        for hard regs since it can result in a circular dependency
+        chain for registers which have values at function entry.
+
+        The test above is not sufficient because the scheduler may move
+        a copy out of an arg reg past the NOTE_INSN_FUNCTION_BEGIN.  */
+      if (REGNO (src) >= FIRST_PSEUDO_REGISTER
+         && reg_base_value[REGNO (src)])
        return reg_base_value[REGNO (src)];
 
       return src;