aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2001-11-03 16:14:05 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2001-11-03 11:14:05 -0500
commitd6b6783b3fcda81f149886129180bedadc852f17 (patch)
tree6c5bec20b5dcec4513cf3759c7bfe01540807fc1 /gcc/expr.c
parent6b3736a12b14c2d2dddafeea0941aaaf413af393 (diff)
downloadgcc-d6b6783b3fcda81f149886129180bedadc852f17.zip
gcc-d6b6783b3fcda81f149886129180bedadc852f17.tar.gz
gcc-d6b6783b3fcda81f149886129180bedadc852f17.tar.bz2
expr.c (expand_expr, [...]): If at top level, don't call force_const_mem.
* expr.c (expand_expr, case ADDDR_EXPR): If at top level, don't call force_const_mem. From-SVN: r46735
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 32b193a..2652781 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -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