From: Richard Henderson Date: Fri, 31 Jan 2014 19:35:31 +0000 (-0800) Subject: re PR middle-end/60004 (Conditional return within transaction causes ICE) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=efa7882fa699212d9d5417df3e39882e831eacbb;p=gcc.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. * g++.dg/tm/pr60004.C: New. From-SVN: r207367 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 621a344195b..93ebbb9efc0 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-31 Ilya Tocar * config/i386/avx512fintrin.h (_MM_FROUND_TO_NEAREST_INT), diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fca54d7cd30..014dc08fbfd 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2014-01-31 Richard Henderson + + * g++.dg/tm/pr60004.C: New. + 2014-01-31 Paolo Carlini PR c++/59082 diff --git a/gcc/testsuite/g++.dg/tm/pr60004.C b/gcc/testsuite/g++.dg/tm/pr60004.C new file mode 100644 index 00000000000..b8c2c0e032b --- /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 0c8282e3754..e9c714c7714 100644 --- a/gcc/tree-eh.c +++ b/gcc/tree-eh.c @@ -1388,9 +1388,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; @@ -1476,6 +1473,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. */