]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
(copy_constant): Copy operand of ADDR_EXPR if it is a constant.
authorJim Wilson <wilson@gcc.gnu.org>
Fri, 10 Mar 1995 19:28:07 +0000 (11:28 -0800)
committerJim Wilson <wilson@gcc.gnu.org>
Fri, 10 Mar 1995 19:28:07 +0000 (11:28 -0800)
From-SVN: r9164

gcc/varasm.c

index 537d9b272f48d5968414a92a84c2d7b433063a39..818628ba27385415f3db46c42ad96c565987449f 100644 (file)
@@ -2568,12 +2568,18 @@ copy_constant (exp)
 {
   switch (TREE_CODE (exp))
     {
+    case ADDR_EXPR:
+      /* For ADDR_EXPR, we do not want to copy the decl whose address
+        is requested.  We do want to copy constants though.  */
+      if (TREE_CODE_CLASS (TREE_CODE (TREE_OPERAND (exp, 0))) == 'c')
+       return build1 (TREE_CODE (exp), TREE_TYPE (exp),
+                      copy_constant (TREE_OPERAND (exp, 0)));
+      else
+       return copy_node (exp);
+
     case INTEGER_CST:
     case REAL_CST:
     case STRING_CST:
-    case ADDR_EXPR:
-      /* For ADDR_EXPR, we do not want to copy the decl
-        whose address is requested.  */
       return copy_node (exp);
 
     case COMPLEX_CST: