diff options
author | Kai Tietz <ktietz@redhat.com> | 2011-05-12 20:19:07 +0200 |
---|---|---|
committer | Kai Tietz <ktietz@gcc.gnu.org> | 2011-05-12 20:19:07 +0200 |
commit | 1d15f620aa4e68f6298491d52ca8cc8d496457a6 (patch) | |
tree | adcc70e35c9e266924a73609b2a5e907b5c51dd0 /gcc/tree-cfg.c | |
parent | c2b5fc8de6a06b34a60f90bb37c46e27dc67d347 (diff) | |
download | gcc-1d15f620aa4e68f6298491d52ca8cc8d496457a6.zip gcc-1d15f620aa4e68f6298491d52ca8cc8d496457a6.tar.gz gcc-1d15f620aa4e68f6298491d52ca8cc8d496457a6.tar.bz2 |
gimplify.c (gimple_boolify): Re-boolify expression arguments even if expression type is of kind BOOLEAN_TYPE.
2011-05-12 Kai Tietz <ktietz@redhat.com>
* gimplify.c (gimple_boolify): Re-boolify expression
arguments even if expression type is of kind BOOLEAN_TYPE.
(gimplify_boolean_expr): Removed.
(gimplify_expr): Boolify truth opcodes AND, ANDIF, OR, ORIF,
and XOR. Additional take care that we keep expression's type.
* tree-cfg.c (verify_gimple_assign_binary): Adjust check for type
of TRUTH_AND|OR|XOR_EXPR.
From-SVN: r173711
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r-- | gcc/tree-cfg.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index e1f8707..aa73f5e 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -3541,10 +3541,10 @@ do_pointer_plus_expr_check: case TRUTH_OR_EXPR: case TRUTH_XOR_EXPR: { - /* We allow any kind of integral typed argument and result. */ - if (!INTEGRAL_TYPE_P (rhs1_type) - || !INTEGRAL_TYPE_P (rhs2_type) - || !INTEGRAL_TYPE_P (lhs_type)) + /* We allow only boolean typed or compatible argument and result. */ + if (!useless_type_conversion_p (boolean_type_node, rhs1_type) + || !useless_type_conversion_p (boolean_type_node, rhs2_type) + || !useless_type_conversion_p (boolean_type_node, lhs_type)) { error ("type mismatch in binary truth expression"); debug_generic_expr (lhs_type); |