summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2011-05-18 10:36:45 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2011-05-18 10:36:45 +0000
commit9ad3a576364f5a1e52849c505ef6ac844c90260b (patch)
treed9ef4a82dfd135eec5040536e17c442f8e9077e8 /gcc/tree-ssa.c
parent4fb583ad0dcd55b1873e5095fc0227915df8fe72 (diff)
downloadgcc-9ad3a576364f5a1e52849c505ef6ac844c90260b.tar.gz
2011-05-18 Richard Guenther <rguenther@suse.de>
PR middle-end/48989 * tree-cfg.c (verify_gimple_assign_unary): Adjust TRUTH op operand verification. (verify_gimple_assign_binary): Likewise. * tree-ssa.c (useless_type_conversion_p): Preserve conversions to non-1-precision BOOLEAN_TYPEs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@173854 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa.c')
-rw-r--r--gcc/tree-ssa.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index ba5a20b6e47..f0bbf3b9823 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -1306,6 +1306,13 @@ useless_type_conversion_p (tree outer_type, tree inner_type)
|| TYPE_PRECISION (inner_type) != TYPE_PRECISION (outer_type))
return false;
+ /* Preserve conversions to BOOLEAN_TYPE if it is not of precision
+ one. */
+ if (TREE_CODE (inner_type) != BOOLEAN_TYPE
+ && TREE_CODE (outer_type) == BOOLEAN_TYPE
+ && TYPE_PRECISION (outer_type) != 1)
+ return false;
+
/* We don't need to preserve changes in the types minimum or
maximum value in general as these do not generate code
unless the types precisions are different. */