summaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2008-06-06 13:23:04 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2008-06-06 13:23:04 +0000
commit538f00d1ab3ac6c5e983fa20b83e51a847bd264a (patch)
tree2965765652d726e67bf65292d51694cbda2c191d /gcc/gimplify.c
parentfd6481cf2e4413bca3ef43b1e504e1c78de6025d (diff)
downloadgcc-538f00d1ab3ac6c5e983fa20b83e51a847bd264a.tar.gz
PR target/36362
* gimplify.c (gimplify_expr) <case TRUTH_NOT_EXPR>: If *expr_p type is not bool, boolify the whole *expr_p and convert to the desired type. * gcc.c-torture/execute/20080529-1.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@136434 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 0c2e5e24405..47a2fe7b43d 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -5890,8 +5890,14 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
break;
case TRUTH_NOT_EXPR:
- TREE_OPERAND (*expr_p, 0)
- = gimple_boolify (TREE_OPERAND (*expr_p, 0));
+ if (TREE_CODE (TREE_TYPE (*expr_p)) != BOOLEAN_TYPE)
+ {
+ tree type = TREE_TYPE (*expr_p);
+ *expr_p = fold_convert (type, gimple_boolify (*expr_p));
+ ret = GS_OK;
+ break;
+ }
+
ret = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
is_gimple_val, fb_rvalue);
recalculate_side_effects (*expr_p);