Commit 26d75703 by Richard Biener Committed by Richard Biener

fold-const.c (fold_single_bit_test): Fix overflow test.

2013-08-30  Richard Biener  <rguenther@suse.de>

	* fold-const.c (fold_single_bit_test): Fix overflow test.

From-SVN: r202103
parent f7e088e7
2013-08-30 Richard Biener <rguenther@suse.de>
* fold-const.c (fold_single_bit_test): Fix overflow test.
2013-08-30 Eric Botcazou <ebotcazou@adacore.com> 2013-08-30 Eric Botcazou <ebotcazou@adacore.com>
* function.c (assign_parm_setup_reg): For a parameter passed by pointer * function.c (assign_parm_setup_reg): For a parameter passed by pointer
......
...@@ -6634,10 +6634,10 @@ fold_single_bit_test (location_t loc, enum tree_code code, ...@@ -6634,10 +6634,10 @@ fold_single_bit_test (location_t loc, enum tree_code code,
not overflow, adjust BITNUM and INNER. */ not overflow, adjust BITNUM and INNER. */
if (TREE_CODE (inner) == RSHIFT_EXPR if (TREE_CODE (inner) == RSHIFT_EXPR
&& TREE_CODE (TREE_OPERAND (inner, 1)) == INTEGER_CST && TREE_CODE (TREE_OPERAND (inner, 1)) == INTEGER_CST
&& TREE_INT_CST_HIGH (TREE_OPERAND (inner, 1)) == 0 && host_integerp (TREE_OPERAND (inner, 1), 1)
&& bitnum < TYPE_PRECISION (type) && bitnum < TYPE_PRECISION (type)
&& 0 > compare_tree_int (TREE_OPERAND (inner, 1), && (TREE_INT_CST_LOW (TREE_OPERAND (inner, 1))
bitnum - TYPE_PRECISION (type))) < (unsigned) (TYPE_PRECISION (type) - bitnum)))
{ {
bitnum += TREE_INT_CST_LOW (TREE_OPERAND (inner, 1)); bitnum += TREE_INT_CST_LOW (TREE_OPERAND (inner, 1));
inner = TREE_OPERAND (inner, 0); inner = TREE_OPERAND (inner, 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