* fold-const.c (multiple_of_p): Handle BIT_AND_EXPR when
BOTTOM is a power of two.
From-SVN: r92358
+2004-12-18 Richard Henderson <rth@redhat.com>
+
+ * fold-const.c (multiple_of_p): Handle BIT_AND_EXPR when
+ BOTTOM is a power of two.
+
2004-12-18 Richard Henderson <rth@redhat.com>
* tree-nested.c (save_tmp_var): New.
switch (TREE_CODE (top))
{
+ case BIT_AND_EXPR:
+ /* Bitwise and provides a power of two multiple. If the mask is
+ a multiple of BOTTOM then TOP is a multiple of BOTTOM. */
+ if (!integer_pow2p (bottom))
+ return 0;
+ /* FALLTHRU */
+
case MULT_EXPR:
return (multiple_of_p (type, TREE_OPERAND (top, 0), bottom)
|| multiple_of_p (type, TREE_OPERAND (top, 1), bottom));