From: Richard Biener Date: Wed, 20 Jul 2011 13:36:30 +0000 (+0000) Subject: re PR middle-end/18908 (Missed folding opportunities with bools) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c56db1005607c9d0fb552280c2065ecbe7bb2b23;p=gcc.git re PR middle-end/18908 (Missed folding opportunities with bools) 2011-07-20 Richard Guenther PR middle-end/18908 * tree.c (integer_all_onesp): Use TYPE_PRECISION, not mode precision. * tree-ssa-forwprop.c (simplify_bitwise_binary): Remove bogus ADDR_EXPR folding. Canonicalize X ^ ~0 as ~X. * gcc.dg/tree-ssa/pr18908.c: New testcase. * gcc.dg/tree-ssa/bitwise-sink.c: Adjust. From-SVN: r176510 --- diff --git a/gcc/tree.c b/gcc/tree.c index 8c44851a18b..30ff80f152f 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -1759,9 +1759,7 @@ integer_all_onesp (const_tree expr) if (!uns) return 0; - /* Note that using TYPE_PRECISION here is wrong. We care about the - actual bits, not the (arbitrary) range of the type. */ - prec = GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (expr))); + prec = TYPE_PRECISION (TREE_TYPE (expr)); if (prec >= HOST_BITS_PER_WIDE_INT) { HOST_WIDE_INT high_value;