aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-06-02 08:13:33 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1994-06-02 08:13:33 -0400
commit119af78aa8c30f259b00678717ef67a0619cfe4e (patch)
tree5fd7645b59cca8c3cee69ce3c90c7f68116bb26d
parent94b25f81caba08a4b8a4d031d7df61b287d19b8e (diff)
downloadgcc-119af78aa8c30f259b00678717ef67a0619cfe4e.zip
gcc-119af78aa8c30f259b00678717ef67a0619cfe4e.tar.gz
gcc-119af78aa8c30f259b00678717ef67a0619cfe4e.tar.bz2
(expand_expr, case ADDR_EXPR): If result is ignored, just return
const0_rtx. From-SVN: r7421
-rw-r--r--gcc/expr.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index edfd2ee..2e0f5ef 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -5863,6 +5863,12 @@ expand_expr (exp, target, tmode, modifier)
(modifier == EXPAND_INITIALIZER
? modifier : EXPAND_CONST_ADDRESS));
+ /* If we are going to ignore the result, OP0 will have been set
+ to const0_rtx, so just return it. Don't get confused and
+ think we are taking the address of the constant. */
+ if (ignore)
+ return op0;
+
/* We would like the object in memory. If it is a constant,
we can have it be statically allocated into memory. For
a non-constant (REG, SUBREG or CONCAT), we need to allocate some