summaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 032885ece9d..b3d55a5e155 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1238,6 +1238,9 @@ make_decl_rtl (tree decl)
"optimization may eliminate reads and/or "
"writes to register variables");
+ if (TREE_STATIC (decl))
+ use_rtl_permanent_mem ();
+
/* 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. This usage is
@@ -1248,6 +1251,9 @@ make_decl_rtl (tree decl)
REG_USERVAR_P (DECL_RTL (decl)) = 1;
if (TREE_STATIC (decl))
+ use_rtl_function_mem ();
+
+ if (TREE_STATIC (decl))
{
/* Make this register global, so not usable for anything
else. */