aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2011-05-18 10:36:45 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2011-05-18 10:36:45 +0000
commit51c213f79189dd3527d1f66137c57bc4e68ec2d1 (patch)
treed9ef4a82dfd135eec5040536e17c442f8e9077e8 /gcc/tree-ssa.c
parent8f5e543422f5d052c6097e4283e21307445bf7ba (diff)
downloadgcc-51c213f79189dd3527d1f66137c57bc4e68ec2d1.zip
gcc-51c213f79189dd3527d1f66137c57bc4e68ec2d1.tar.gz
gcc-51c213f79189dd3527d1f66137c57bc4e68ec2d1.tar.bz2
re PR middle-end/48989 (FAIL: gfortran.dg/lto/pr46036 f_lto_pr46036_0.o assemble)
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. From-SVN: r173854
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 ba5a20b..f0bbf3b 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. */