From: J"orn Rennecke Date: Fri, 14 Aug 1998 13:58:02 +0000 (+0000) Subject: expr.c (store_expr): Don't optimize away load-store pair when either source or destin... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6036acbbf2daa09fde4b435fd053adcf88fe492a;p=gcc.git expr.c (store_expr): Don't optimize away load-store pair when either source or destination have a... * expr.c (store_expr): Don't optimize away load-store pair when either source or destination have a side effect. From-SVN: r21732 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ade8ecfb70f..11d6b7cd1e9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Fri Aug 14 21:52:53 1998 J"orn Rennecke + + * 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 * genrecog.c (add_to_sequence): Fatal error if the modes of the operands diff --git a/gcc/expr.c b/gcc/expr.c index 7f1b35f859e..ce1a601cc2d 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -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)