aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-06-06 15:23:04 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2008-06-06 15:23:04 +0200
commit673390625d47454c13f53fdf229bb3565ee6b2fc (patch)
tree2965765652d726e67bf65292d51694cbda2c191d /gcc/gimplify.c
parenta68ab3517348178c71d9adcdefbc81de2d8c7390 (diff)
downloadgcc-673390625d47454c13f53fdf229bb3565ee6b2fc.zip
gcc-673390625d47454c13f53fdf229bb3565ee6b2fc.tar.gz
gcc-673390625d47454c13f53fdf229bb3565ee6b2fc.tar.bz2
re PR target/36362 (ICE in simplify_subreg)
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. From-SVN: r136434
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 0c2e5e2..47a2fe7 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);