aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2008-09-11 14:53:20 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2008-09-11 14:53:20 +0000
commit420da8caae151d84ef45e31cf058e9832d856b9e (patch)
tree9c89799f44ae4d4e96a1e79f7af70fca2353d8c8 /gcc/fold-const.c
parent308216549297c41fb602dced560fa1ed8af0f8f6 (diff)
downloadgcc-420da8caae151d84ef45e31cf058e9832d856b9e.zip
gcc-420da8caae151d84ef45e31cf058e9832d856b9e.tar.gz
gcc-420da8caae151d84ef45e31cf058e9832d856b9e.tar.bz2
tree-vectorizer.c (slpeel_add_loop_guard): Fix types.
2008-09-11 Richard Guenther <rguenther@suse.de> * tree-vectorizer.c (slpeel_add_loop_guard): Fix types. (set_prologue_iterations): Likewise. * tree-vect-transform.c (vect_create_addr_base_for_vector_ref): Likewise. (vect_update_init_of_dr): Likewise. * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Fix type verification. * fold-const.c (fold_unary): Do not generate calculations in sub-types. From-SVN: r140291
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index aea7a65..2c822b5 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -7883,7 +7883,9 @@ fold_unary (enum tree_code code, tree type, tree op0)
transformation effectively doesn't preserve non-maximal ranges. */
if (TREE_CODE (type) == INTEGER_TYPE
&& TREE_CODE (op0) == BIT_AND_EXPR
- && TREE_CODE (TREE_OPERAND (op0, 1)) == INTEGER_CST)
+ && TREE_CODE (TREE_OPERAND (op0, 1)) == INTEGER_CST
+ /* Not if the conversion is to the sub-type. */
+ && TREE_TYPE (type) != TREE_TYPE (op0))
{
tree and = op0;
tree and0 = TREE_OPERAND (and, 0), and1 = TREE_OPERAND (and, 1);