aboutsummaryrefslogtreecommitdiff
path: root/gcc/simplify-rtx.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/simplify-rtx.cc')
-rw-r--r--gcc/simplify-rtx.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/simplify-rtx.cc b/gcc/simplify-rtx.cc
index 3aaabdc..8016e02 100644
--- a/gcc/simplify-rtx.cc
+++ b/gcc/simplify-rtx.cc
@@ -3189,7 +3189,9 @@ simplify_context::simplify_binary_operation_1 (rtx_code code,
rhs = XEXP (rhs, 0);
}
- if (rtx_equal_p (lhs, rhs))
+ /* Keep PLUS of 2 volatile memory references. */
+ if (rtx_equal_p (lhs, rhs)
+ && (!MEM_P (lhs) || !MEM_VOLATILE_P (lhs)))
{
rtx orig = gen_rtx_PLUS (int_mode, op0, op1);
rtx coeff;