OSDN Git Service

* expr.c (expand_expr, case ADDDR_EXPR): If at top level, don't call
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 3 Nov 2001 16:14:05 +0000 (16:14 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 3 Nov 2001 16:14:05 +0000 (16:14 +0000)
force_const_mem.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46735 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/expr.c

index bbdb844..41843f6 100644 (file)
@@ -1,5 +1,8 @@
 Sat Nov  3 10:37:56 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
 
+       * expr.c (expand_expr, case ADDDR_EXPR): If at top level, don't call
+       force_const_mem.
+
        * reload.c (combine_reloads): Don't combine an output reload if there
        are other reloads around for part of the output.
 
index 32b193a..2652781 100644 (file)
@@ -8671,6 +8671,14 @@ expand_expr (exp, target, tmode, modifier)
         return a zero.  */
       else if (TREE_CODE (TREE_OPERAND (exp, 0)) == ERROR_MARK)
        return const0_rtx;
+      /* If we are taking the address of a constant and are at the
+        top level, we have to use output_constant_def since we can't
+        call force_const_mem at top level.  */
+      else if (cfun == 0
+              && (TREE_CODE (TREE_OPERAND (exp, 0)) == CONSTRUCTOR
+                  || (TREE_CODE_CLASS (TREE_CODE (TREE_OPERAND (exp, 0)))
+                      == 'c')))
+       op0 = XEXP (output_constant_def (TREE_OPERAND (exp, 0), 0), 0);
       else
        {
          /* We make sure to pass const0_rtx down if we came in with