Commit 85ca20c9 by Segher Boessenkool Committed by Segher Boessenkool

combine: Don't call extract_left_shift with count < 0 (PR67483)

If the compiled program does a shift by a negative amount, combine will
happily work with that, but it shouldn't then do an undefined operation
in GCC itself.  This patch fixes the first case mentioned in the bug
report (I haven't been able to reproduce the second case, on trunk at
least).


	PR rtl-optimization/67483
	* combine.c (make_compound_operation): Don't call extract_left_shift
	with negative shift amounts.

From-SVN: r236232
parent aa4b467b
2016-05-13 Segher Boessenkool <segher@kernel.crashing.org>
PR rtl-optimization/67483
* combine.c (make_compound_operation): Don't call extract_left_shift
with negative shift amounts.
2016-05-13 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/71071
......
......@@ -8037,6 +8037,7 @@ make_compound_operation (rtx x, enum rtx_code in_code)
&& ! (GET_CODE (lhs) == SUBREG
&& (OBJECT_P (SUBREG_REG (lhs))))
&& CONST_INT_P (rhs)
&& INTVAL (rhs) >= 0
&& INTVAL (rhs) < HOST_BITS_PER_WIDE_INT
&& INTVAL (rhs) < mode_width
&& (new_rtx = extract_left_shift (lhs, INTVAL (rhs))) != 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment