aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-09-17 00:08:01 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2008-09-17 00:08:01 +0200
commit8c50b4950276e667112e1999018ab792a9e24134 (patch)
tree1fe1f03500d1e925cfdab311883d9cd8a69c4e11 /gcc/gimplify.c
parentcc8b343d265200a3bd9fa1eccfa2db35499cb5c7 (diff)
downloadgcc-8c50b4950276e667112e1999018ab792a9e24134.zip
gcc-8c50b4950276e667112e1999018ab792a9e24134.tar.gz
gcc-8c50b4950276e667112e1999018ab792a9e24134.tar.bz2
re PR c/37529 (ICE with invalid goto)
PR c/37529 * gimplify.c (gimplify_expr) <case GOTO_EXPR>: If gimplification of GOTO_DESTINATION failed, don't create GIMPLE_GOTO. * gcc.dg/pr37529.c: New test. From-SVN: r140402
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 81b21c5..bb38ba3 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -6483,8 +6483,12 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
/* If the target is not LABEL, then it is a computed jump
and the target needs to be gimplified. */
if (TREE_CODE (GOTO_DESTINATION (*expr_p)) != LABEL_DECL)
- ret = gimplify_expr (&GOTO_DESTINATION (*expr_p), pre_p,
- NULL, is_gimple_val, fb_rvalue);
+ {
+ ret = gimplify_expr (&GOTO_DESTINATION (*expr_p), pre_p,
+ NULL, is_gimple_val, fb_rvalue);
+ if (ret == GS_ERROR)
+ break;
+ }
gimplify_seq_add_stmt (pre_p,
gimple_build_goto (GOTO_DESTINATION (*expr_p)));
break;