aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1993-04-25 13:00:40 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1993-04-25 13:00:40 -0400
commit31e4b1c0990daaa780524bf61f060049571f018b (patch)
tree63c1bf13ac8e4d259e06c71c2f84d981af1f96fb /gcc
parente09d75bd9717621c55282547bd4d9c8c1489a5bf (diff)
downloadgcc-31e4b1c0990daaa780524bf61f060049571f018b.zip
gcc-31e4b1c0990daaa780524bf61f060049571f018b.tar.gz
gcc-31e4b1c0990daaa780524bf61f060049571f018b.tar.bz2
(make_decl_rtl): If a variable has an asm operand that refers to,
e.g., fp, make a distinct RTL for it. From-SVN: r4215
Diffstat (limited to 'gcc')
-rw-r--r--gcc/varasm.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 50b348f..16bb816 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -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)