OSDN Git Service

(store_expr): When storing promoted value, don't return MEM if address
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 29 Sep 1995 11:47:40 +0000 (11:47 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 29 Sep 1995 11:47:40 +0000 (11:47 +0000)
contains target.

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

gcc/expr.c

index 998303a..a1fda98 100644 (file)
@@ -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