]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
From Joern:
authorJeffrey A Law <law@cygnus.com>
Sat, 15 Aug 1998 00:41:25 +0000 (00:41 +0000)
committerJeff Law <law@gcc.gnu.org>
Sat, 15 Aug 1998 00:41:25 +0000 (18:41 -0600)
        * expr.c (store_expr): Don't optimize away load-store pair
        when either source or destination have a side effect.

From-SVN: r21745

gcc/ChangeLog
gcc/expr.c

index 819acb64c754e9e17f041d0f9fbff78e3be66265..716c5d43d111fc905326e25d5997d6810a2297d9 100644 (file)
@@ -1,5 +1,9 @@
 Fri Aug 14 21:07:03 1998  Jeffrey A Law  (law@cygnus.com)
 
+       From Joern:
+       * expr.c (store_expr): Don't optimize away load-store pair
+       when either source or destination have a side effect.
+
        * loop.c (add_label_notes): Do not ignore references to labels
        before dispatch tables.  Mirrors Apr 8 change to mark_jump_label.
        * gcse.c (add_label_notes): Similarly.
index ceb537e721ed9c784ae5f4388b5153685fdd0bf9..0eb20dcb0bf8eb51318894f737e4675f040bfa15 100644 (file)
@@ -3457,7 +3457,10 @@ store_expr (exp, target, want_value)
   /* If value was not generated in the target, store it there.
      Convert the value to TARGET's type first if nec.  */
 
-  if (! rtx_equal_p (temp, target) && TREE_CODE (exp) != ERROR_MARK)
+  if ((! rtx_equal_p (temp, target)
+       || side_effects_p (temp)
+       || side_effects_p (target))
+      && TREE_CODE (exp) != ERROR_MARK)
     {
       target = protect_from_queue (target, 1);
       if (GET_MODE (temp) != GET_MODE (target)