expr.c (store_expr): Don't optimize away load-store pair when either source or destin...
authorJ"orn Rennecke <amylaar@cygnus.co.uk>
Fri, 14 Aug 1998 13:58:02 +0000 (13:58 +0000)
committerJoern Rennecke <amylaar@gcc.gnu.org>
Fri, 14 Aug 1998 13:58:02 +0000 (14:58 +0100)
* expr.c (store_expr): Don't optimize away load-store pair
when either source or destination have a side effect.

From-SVN: r21732

gcc/ChangeLog
gcc/expr.c

index ade8ecfb70f455f16aac1ee49af87543122ba8b0..11d6b7cd1e9aa85eeaa35bdfe6ae468161c85191 100644 (file)
@@ -1,3 +1,8 @@
+Fri Aug 14 21:52:53 1998  J"orn Rennecke <amylaar@cygnus.co.uk>
+
+       * expr.c (store_expr): Don't optimize away load-store pair
+       when either source or destination have a side effect.
+
 Fri Aug 14 16:50:10 1998  John Carr  <jfc@mit.edu>
 
        * genrecog.c (add_to_sequence): Fatal error if the modes of the operands
index 7f1b35f859e069988a32ad4b732042e6815a018c..ce1a601cc2d6c4981fe106cb3fcec3799d9e8fef 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)