aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-09-17 00:06:28 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2008-09-17 00:06:28 +0200
commitcc8b343d265200a3bd9fa1eccfa2db35499cb5c7 (patch)
tree876ce5c7a63823800eed11d44476606577a8b06b /gcc/gimplify.c
parent326a4d4ef1c3b80f4cfbf17f52a42c263abb25df (diff)
downloadgcc-cc8b343d265200a3bd9fa1eccfa2db35499cb5c7.zip
gcc-cc8b343d265200a3bd9fa1eccfa2db35499cb5c7.tar.gz
gcc-cc8b343d265200a3bd9fa1eccfa2db35499cb5c7.tar.bz2
re PR c++/37530 (ICE with invalid catch)
PR c++/37530 * gimplify.c (gimplify_expr) <case TRY_CATCH_EXPR>: Don't create GIMPLE_TRY if cleanup sequence is empty. * g++.dg/parse/crash48.C: New test. From-SVN: r140401
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 4f52257..81b21c5 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -6586,6 +6586,13 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
eval = cleanup = NULL;
gimplify_and_add (TREE_OPERAND (*expr_p, 0), &eval);
gimplify_and_add (TREE_OPERAND (*expr_p, 1), &cleanup);
+ /* Don't create bogus GIMPLE_TRY with empty cleanup. */
+ if (gimple_seq_empty_p (cleanup))
+ {
+ gimple_seq_add_seq (pre_p, eval);
+ ret = GS_ALL_DONE;
+ break;
+ }
try_ = gimple_build_try (eval, cleanup,
TREE_CODE (*expr_p) == TRY_FINALLY_EXPR
? GIMPLE_TRY_FINALLY