aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorJ"orn Rennecke <amylaar@cygnus.co.uk>1998-08-14 13:58:02 +0000
committerJoern Rennecke <amylaar@gcc.gnu.org>1998-08-14 14:58:02 +0100
commit6036acbbf2daa09fde4b435fd053adcf88fe492a (patch)
tree9f6e54438bcf5f94755741d5145f04249e4d794b /gcc/expr.c
parent141dba98fdd28e263dbdf626ee97dd5cf70d3d86 (diff)
downloadgcc-6036acbbf2daa09fde4b435fd053adcf88fe492a.zip
gcc-6036acbbf2daa09fde4b435fd053adcf88fe492a.tar.gz
gcc-6036acbbf2daa09fde4b435fd053adcf88fe492a.tar.bz2
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
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 7f1b35f..ce1a601 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)