Commit 29317008 by Richard Henderson Committed by Richard Henderson

fold-const.c (multiple_of_p): Handle BIT_AND_EXPR when BOTTOM is a power of two.

        * fold-const.c (multiple_of_p): Handle BIT_AND_EXPR when
        BOTTOM is a power of two.

From-SVN: r92358
parent c529c27e
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.
(struct walk_stmt_info): Add is_lhs.
(walk_stmts) <MODIFY_EXPR>: Be more accurate with setting of
......
......@@ -9541,6 +9541,13 @@ multiple_of_p (tree type, tree top, tree bottom)
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));
......
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