summaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2008-09-16 22:06:28 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2008-09-16 22:06:28 +0000
commitd38ef55bac40228f56451376c85136d4b577d784 (patch)
tree876ce5c7a63823800eed11d44476606577a8b06b /gcc/gimplify.c
parentcc88e3b29444ec74c2e85db1ddb81a96055692ee (diff)
downloadgcc-d38ef55bac40228f56451376c85136d4b577d784.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140401 138bc75d-0d04-0410-961f-82ee72b054a4
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 4f522577e61..81b21c5fa66 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