From: Richard Henderson Date: Sat, 1 Feb 2014 05:24:07 +0000 (-0800) Subject: re PR middle-end/60004 (Conditional return within transaction causes ICE) X-Git-Tag: releases/gcc-4.8.3~391 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=10a95d660686b9b3e9ab0dd66eb560f8df55152a;p=thirdparty%2Fgcc.git re PR middle-end/60004 (Conditional return within transaction causes ICE) PR middle-end/60004 * tree-eh.c (lower_try_finally_switch): Delay lowering finally block until after else_eh is processed. From-SVN: r207381 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e3020fcbd62b..65140b52eded 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-01-31 Richard Henderson + + PR middle-end/60004 + * tree-eh.c (lower_try_finally_switch): Delay lowering finally block + until after else_eh is processed. + 2014-01-30 David Holsgrove Backport from mainline @@ -199,7 +205,7 @@ Backport from mainline 2014-01-15 Matthew Gretton-Dann - Kugan Vivekanandarajah + Kugan Vivekanandarajah PR target/59695 * config/aarch64/aarch64.c (aarch64_build_constant): Fix incorrect diff --git a/gcc/testsuite/g++.dg/tm/pr60004.C b/gcc/testsuite/g++.dg/tm/pr60004.C new file mode 100644 index 000000000000..b8c2c0e032b1 --- /dev/null +++ b/gcc/testsuite/g++.dg/tm/pr60004.C @@ -0,0 +1,10 @@ +// { dg-do compile } +// { dg-options "-fgnu-tm" } + +int a; +int f() { + __transaction_atomic { + if (a == 5) + return 1; + } +} diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c index 973782ba5a86..41b55acbc77d 100644 --- a/gcc/tree-eh.c +++ b/gcc/tree-eh.c @@ -1357,9 +1357,6 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf) x = gimple_seq_last_stmt (finally); finally_loc = x ? gimple_location (x) : tf_loc; - /* Lower the finally block itself. */ - lower_eh_constructs_1 (state, &finally); - /* Prepare for switch statement generation. */ nlabels = tf->dest_array.length (); return_index = nlabels; @@ -1445,6 +1442,7 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf) x = gimple_build_label (finally_label); gimple_seq_add_stmt (&tf->top_p_seq, x); + lower_eh_constructs_1 (state, &finally); gimple_seq_add_seq (&tf->top_p_seq, finally); /* Redirect each incoming goto edge. */