]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
expr.c (store_expr): If the lhs is a memory location pointed to be a postincremented...
authorCharles M. Hannum <root@ihack.net>
Wed, 6 Jan 1999 01:28:08 +0000 (18:28 -0700)
committerJeff Law <law@gcc.gnu.org>
Wed, 6 Jan 1999 01:28:08 +0000 (18:28 -0700)

        * expr.c (store_expr): If the lhs is a memory location pointed
        to be a postincremented (or postdecremented) pointer, always
        force the rhs to be evaluated into a pseudo.

From-SVN: r24505

gcc/ChangeLog
gcc/expr.c

index c034344c34d3629ee54ef7174a2531d205f1ccea..ab6f020410d0a3b25a66b889974b6a3a350e7ae7 100644 (file)
@@ -1,3 +1,9 @@
+Wed Jan  6 02:23:36 1999  "Charles M. Hannum" <root@ihack.net>
+
+       * expr.c (store_expr): If the lhs is a memory location pointed
+       to be a postincremented (or postdecremented) pointer, always
+       force the rhs to be evaluated into a pseudo.
+
 Fri Jan  1 11:48:20 1999  Jeffrey A Law  (law@cygnus.com)
 
        * i386.md (doubleword shifts): Fix dumb mistakes in previous change.
index 0d7f0034152db2b3e536aa971073bca57ed69205..18abfc6d05c4bc412e89ce87a6f1a69c59eb5787 100644 (file)
@@ -3327,21 +3327,6 @@ store_expr (exp, target, want_value)
 
       return want_value ? target : NULL_RTX;
     }
-  else if (want_value && GET_CODE (target) == MEM && ! MEM_VOLATILE_P (target)
-          && GET_MODE (target) != BLKmode)
-    /* If target is in memory and caller wants value in a register instead,
-       arrange that.  Pass TARGET as target for expand_expr so that,
-       if EXP is another assignment, WANT_VALUE will be nonzero for it.
-       We know expand_expr will not use the target in that case.
-       Don't do this if TARGET is volatile because we are supposed
-       to write it and then read it.  */
-    {
-      temp = expand_expr (exp, cse_not_expected ? NULL_RTX : target,
-                         GET_MODE (target), 0);
-      if (GET_MODE (temp) != BLKmode && GET_MODE (temp) != VOIDmode)
-       temp = copy_to_reg (temp);
-      dont_return_target = 1;
-    }
   else if (queued_subexp_p (target))
     /* If target contains a postincrement, let's not risk
        using it as the place to generate the rhs.  */
@@ -3361,6 +3346,21 @@ store_expr (exp, target, want_value)
       if (! MEM_VOLATILE_P (target) && want_value)
        dont_return_target = 1;
     }
+  else if (want_value && GET_CODE (target) == MEM && ! MEM_VOLATILE_P (target)
+          && GET_MODE (target) != BLKmode)
+    /* If target is in memory and caller wants value in a register instead,
+       arrange that.  Pass TARGET as target for expand_expr so that,
+       if EXP is another assignment, WANT_VALUE will be nonzero for it.
+       We know expand_expr will not use the target in that case.
+       Don't do this if TARGET is volatile because we are supposed
+       to write it and then read it.  */
+    {
+      temp = expand_expr (exp, cse_not_expected ? NULL_RTX : target,
+                         GET_MODE (target), 0);
+      if (GET_MODE (temp) != BLKmode && GET_MODE (temp) != VOIDmode)
+       temp = copy_to_reg (temp);
+      dont_return_target = 1;
+    }
   else if (GET_CODE (target) == SUBREG && SUBREG_PROMOTED_VAR_P (target))
     /* If this is an scalar in a register that is stored in a wider mode
        than the declared mode, compute the result into its declared mode