summaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
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