aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorKai Tietz <ktietz@redhat.com>2011-05-13 15:37:16 +0200
committerKai Tietz <ktietz@gcc.gnu.org>2011-05-13 15:37:16 +0200
commit3c6cbf7ad1abf48e18c7130feb6e4f60fad938f7 (patch)
treeb843d80ae46c2b1f7619c542f88fb859c50782cc /gcc/gimplify.c
parent2e7f5dc0e434647df5e36133a81500139635e131 (diff)
downloadgcc-3c6cbf7ad1abf48e18c7130feb6e4f60fad938f7.zip
gcc-3c6cbf7ad1abf48e18c7130feb6e4f60fad938f7.tar.gz
gcc-3c6cbf7ad1abf48e18c7130feb6e4f60fad938f7.tar.bz2
gimplify.c (gimplify_expr): Make sure operand is boolified.
2011-05-13 Kai Tietz <ktietz@redhat.com> * gimplify.c (gimplify_expr): Make sure operand is boolified. * tree-cfg.c (verify_gimple_assign_unary): Check for boolean compatible type for TRUTH_NOT_EXPR. From-SVN: r173732
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 33a76a2..d776692 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -6754,13 +6754,17 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
}
case TRUTH_NOT_EXPR:
- if (TREE_TYPE (*expr_p) != boolean_type_node)
- {
- tree type = TREE_TYPE (*expr_p);
- *expr_p = fold_convert (type, gimple_boolify (*expr_p));
- ret = GS_OK;
- break;
- }
+ {
+ tree org_type = TREE_TYPE (*expr_p);
+
+ *expr_p = gimple_boolify (*expr_p);
+ if (org_type != boolean_type_node)
+ {
+ *expr_p = fold_convert (org_type, *expr_p);
+ ret = GS_OK;
+ break;
+ }
+ }
ret = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
is_gimple_val, fb_rvalue);