aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
authorKai Tietz <ktietz@redhat.com>2011-07-21 14:11:28 +0200
committerKai Tietz <ktietz@gcc.gnu.org>2011-07-21 14:11:28 +0200
commit7f3ff782991c13d787b67918e965c8a1dd620935 (patch)
tree3fcf31bae07e5780a558bd87b46dde066bfb218e /gcc/tree-cfg.c
parent0c53708eadd727f4089028e09840865db25a3cd9 (diff)
downloadgcc-7f3ff782991c13d787b67918e965c8a1dd620935.zip
gcc-7f3ff782991c13d787b67918e965c8a1dd620935.tar.gz
gcc-7f3ff782991c13d787b67918e965c8a1dd620935.tar.bz2
ChangeLog gcc/
2011-07-21 Kai Tietz <ktietz@redhat.com> * fold-const.c (fold_unary_loc): Preserve indirect comparison cast to none-boolean type. * tree-ssa.c (useless_type_conversion_p): Preserve cast from/to boolean-type. * gimplify.c (gimple_boolify): Handle boolification of comparisons. (gimplify_expr): Boolifiy non aggregate-typed comparisons. * tree-cfg.c (verify_gimple_comparison): Check result type of comparison expression. * tree-ssa-forwprop.c (forward_propagate_comparison): Adjust test of condition result and disallow type-cast sinking into comparison. ChangeLog gcc/testsuite 2011-07-21 Kai Tietz <ktietz@redhat.com> * gcc.dg/tree-ssa/pr30978.c: adjusted. * gcc.dg/tree-ssa/ssa-fre-6.c: Likewise. * gcc.dg/binop-xor1.c: Set to fail. * gcc.dg/binop-xor3.c: Set to fail. From-SVN: r176563
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index cd13472..bc71dd6 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -3203,7 +3203,9 @@ verify_gimple_comparison (tree type, tree op0, tree op1)
&& (!POINTER_TYPE_P (op0_type)
|| !POINTER_TYPE_P (op1_type)
|| TYPE_MODE (op0_type) != TYPE_MODE (op1_type)))
- || !INTEGRAL_TYPE_P (type))
+ || !INTEGRAL_TYPE_P (type)
+ || (TREE_CODE (type) != BOOLEAN_TYPE
+ && TYPE_PRECISION (type) != 1))
{
error ("type mismatch in comparison expression");
debug_generic_expr (type);