Commit 7c06f565 by Roger Sayle Committed by Roger Sayle

fold-const.c (optimize_bit_field_compare): Recursively call fold when…

fold-const.c (optimize_bit_field_compare): Recursively call fold when simplifying non-constant comparisons between bit-fields.


	* fold-const.c (optimize_bit_field_compare): Recursively call
	fold when simplifying non-constant comparisons between bit-fields.

From-SVN: r118783
parent 65280f6c
2006-11-13 Roger Sayle <roger@eyesopen.com>
* fold-const.c (optimize_bit_field_compare): Recursively call
fold when simplifying non-constant comparisons between bit-fields.
2006-11-13 Jakub Jelinek <jakub@redhat.com> 2006-11-13 Jakub Jelinek <jakub@redhat.com>
* configure.ac: Add changequote around __LONG_DOUBLE_MATH_OPTIONAL * configure.ac: Add changequote around __LONG_DOUBLE_MATH_OPTIONAL
......
...@@ -3441,15 +3441,19 @@ optimize_bit_field_compare (enum tree_code code, tree compare_type, ...@@ -3441,15 +3441,19 @@ optimize_bit_field_compare (enum tree_code code, tree compare_type,
if (! const_p) if (! const_p)
/* If not comparing with constant, just rework the comparison /* If not comparing with constant, just rework the comparison
and return. */ and return. */
return build2 (code, compare_type, return fold_build2 (code, compare_type,
build2 (BIT_AND_EXPR, unsigned_type, fold_build2 (BIT_AND_EXPR, unsigned_type,
make_bit_field_ref (linner, unsigned_type, make_bit_field_ref (linner,
nbitsize, nbitpos, 1), unsigned_type,
mask), nbitsize, nbitpos,
build2 (BIT_AND_EXPR, unsigned_type, 1),
make_bit_field_ref (rinner, unsigned_type, mask),
nbitsize, nbitpos, 1), fold_build2 (BIT_AND_EXPR, unsigned_type,
mask)); make_bit_field_ref (rinner,
unsigned_type,
nbitsize, nbitpos,
1),
mask));
/* Otherwise, we are handling the constant case. See if the constant is too /* Otherwise, we are handling the constant case. See if the constant is too
big for the field. Warn and return a tree of for 0 (false) if so. We do big for the field. Warn and return a tree of for 0 (false) if so. We do
......
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