Fix rtl-optimization/78596 - combine.c:12561:14: runtime error: left shift of negative value

PR rtl-optimization/78596
	* combine.c (simplify_comparison): Cast to unsigned to avoid
	left shifting of negative value.

From-SVN: r243111
This commit is contained in:
Markus Trippelsdorf 2016-12-01 14:04:13 +00:00 committed by Markus Trippelsdorf
parent 8e9c33cd3b
commit 67586d38f5
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2016-12-01 Markus Trippelsdorf <markus@trippelsdorf.de>
PR rtl-optimization/78596
* combine.c (simplify_comparison): Cast to unsigned to avoid
left shifting of negative value.
2016-12-01 Matthias Klose <doko@ubuntu.com>
* doc/install.texi: Don't use pkg-config to check for bdw-gc.

View File

@ -12561,7 +12561,8 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1)
if (GET_CODE (op0) == LSHIFTRT)
code = unsigned_condition (code);
const_op <<= INTVAL (XEXP (op0, 1));
const_op = (unsigned HOST_WIDE_INT) const_op
<< INTVAL (XEXP (op0, 1));
if (low_bits != 0
&& (code == GT || code == GTU
|| code == LE || code == LEU))