(make_decl_rtl): If a variable has an asm operand that refers to,
authorRichard Kenner <kenner@gcc.gnu.org>
Sun, 25 Apr 1993 17:00:40 +0000 (13:00 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Sun, 25 Apr 1993 17:00:40 +0000 (13:00 -0400)
e.g., fp, make a distinct RTL for it.

From-SVN: r4215

gcc/varasm.c

index 50b348fe8c05bac4908a064f782437120e6aa5d0..16bb816aac853b23e59dc75b7d69f7a5f97a6396 100644 (file)
@@ -354,7 +354,16 @@ make_decl_rtl (decl, asmspec, top_level)
            error ("global register variable follows a function definition");
          if (TREE_THIS_VOLATILE (decl))
            warning ("volatile register variables don't work as you might wish");
-         DECL_RTL (decl) = gen_rtx (REG, DECL_MODE (decl), reg_number);
+
+         /* If the user specified one of the eliminables registers here,
+            e.g., FRAME_POINTER_REGNUM, we don't want to get this variable
+            confused with that register and be eliminated.  Although this
+            usage is somewhat suspect, we nevertheless use the following
+            kludge to avoid setting DECL_RTL to frame_pointer_rtx.  */
+
+         DECL_RTL (decl)
+           = gen_rtx (REG, DECL_MODE (decl), FIRST_PSEUDO_REGISTER);
+         REGNO (DECL_RTL (decl)) = reg_number;
          REG_USERVAR_P (DECL_RTL (decl)) = 1;
 
          if (top_level)