aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1995-09-29 07:47:40 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1995-09-29 07:47:40 -0400
commitf29369b9f2b1d1d7bc55ba044076860b7a636231 (patch)
tree4e575b739815fe64a9e68d32f4f141a9a3cb2399 /gcc
parentd22d5f3433c43d2051725894d106e65785a08afa (diff)
downloadgcc-f29369b9f2b1d1d7bc55ba044076860b7a636231.zip
gcc-f29369b9f2b1d1d7bc55ba044076860b7a636231.tar.gz
gcc-f29369b9f2b1d1d7bc55ba044076860b7a636231.tar.bz2
(store_expr): When storing promoted value, don't return MEM if address
contains target. From-SVN: r10414
Diffstat (limited to 'gcc')
-rw-r--r--gcc/expr.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 998303a..a1fda98 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -2785,8 +2785,11 @@ store_expr (exp, target, want_value)
temp = expand_expr (exp, NULL_RTX, VOIDmode, 0);
/* If TEMP is a volatile MEM and we want a result value, make
- the access now so it gets done only once. */
- if (GET_CODE (temp) == MEM && MEM_VOLATILE_P (temp) && want_value)
+ the access now so it gets done only once. Likewise if
+ it contains TARGET. */
+ if (GET_CODE (temp) == MEM && want_value
+ && (MEM_VOLATILE_P (temp)
+ || reg_mentioned_p (SUBREG_REG (target), XEXP (temp, 0))))
temp = copy_to_reg (temp);
/* If TEMP is a VOIDmode constant, use convert_modes to make