aboutsummaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorsaaadhu <saaadhu@138bc75d-0d04-0410-961f-82ee72b054a4>2018-12-17 13:26:50 +0000
committersaaadhu <saaadhu@138bc75d-0d04-0410-961f-82ee72b054a4>2018-12-17 13:26:50 +0000
commit1cd07e036808bd45812796cc6fd47f9b6764eaae (patch)
tree2293c6087d82c0a19b0f37bdc7ee1c3b1a6308b6 /gcc/combine.c
parentc51441f7f92fe9f4a0a452c1f8d283751ad463c5 (diff)
2018-12-17 Senthil Kumar Selvaraj <senthilkumar.selvaraj@microchip.com>
Backport from trunk 2018-12-17 Senthil Kumar Selvaraj <senthilkumar.selvaraj@microchip.com> PR rtl-optimization/88253 * combine.c (combine_simplify_rtx): Test for side-effects before substituting by zero. 2018-12-17 Senthil Kumar Selvaraj <senthilkumar.selvaraj@microchip.com> Backport from trunk 2018-12-17 Senthil Kumar Selvaraj <senthilkumar.selvaraj@microchip.com> PR rtl-optimization/88253 * gcc.target/avr/pr88253.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@267201 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index bc023d2f994..56f7f491234 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -5807,8 +5807,9 @@ combine_simplify_rtx (rtx x, machine_mode op0_mode, int in_dest,
&& GET_MODE_PRECISION (mode) < GET_MODE_PRECISION (op0_mode)
&& subreg_lowpart_offset (mode, op0_mode) == SUBREG_BYTE (x)
&& HWI_COMPUTABLE_MODE_P (op0_mode)
- && (nonzero_bits (SUBREG_REG (x), op0_mode)
- & GET_MODE_MASK (mode)) == 0)
+ && ((nonzero_bits (SUBREG_REG (x), op0_mode)
+ & GET_MODE_MASK (mode)) == 0)
+ && !side_effects_p (SUBREG_REG (x)))
return CONST0_RTX (mode);
}