diff options
author | Kai Tietz <ktietz@redhat.com> | 2011-07-21 14:11:28 +0200 |
---|---|---|
committer | Kai Tietz <ktietz@gcc.gnu.org> | 2011-07-21 14:11:28 +0200 |
commit | 7f3ff782991c13d787b67918e965c8a1dd620935 (patch) | |
tree | 3fcf31bae07e5780a558bd87b46dde066bfb218e /gcc/tree-ssa.c | |
parent | 0c53708eadd727f4089028e09840865db25a3cd9 (diff) | |
download | gcc-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-ssa.c')
-rw-r--r-- | gcc/tree-ssa.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c index e4d931f..a945e0e 100644 --- a/gcc/tree-ssa.c +++ b/gcc/tree-ssa.c @@ -1306,10 +1306,10 @@ 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 + /* Preserve conversions to/from BOOLEAN_TYPE if types are not + of precision one. */ + if (((TREE_CODE (inner_type) == BOOLEAN_TYPE) + != (TREE_CODE (outer_type) == BOOLEAN_TYPE)) && TYPE_PRECISION (outer_type) != 1) return false; |