]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/60004 (Conditional return within transaction causes ICE)
authorRichard Henderson <rth@gcc.gnu.org>
Sat, 1 Feb 2014 05:24:07 +0000 (21:24 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Sat, 1 Feb 2014 05:24:07 +0000 (21:24 -0800)
PR middle-end/60004

  * tree-eh.c (lower_try_finally_switch): Delay lowering finally block
  until after else_eh is processed.

From-SVN: r207381

gcc/ChangeLog
gcc/testsuite/g++.dg/tm/pr60004.C [new file with mode: 0644]
gcc/tree-eh.c

index e3020fcbd62bd6a10077d7cb52e2742840d394d5..65140b52eded3d43964ce74749b2557ad2967521 100644 (file)
@@ -1,3 +1,9 @@
+2014-01-31  Richard Henderson  <rth@redhat.com>
+
+       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 <david.holsgrove@xilinx.com>
 
        Backport from mainline
 
        Backport from mainline
        2014-01-15  Matthew Gretton-Dann  <matthew.gretton-dann@linaro.org>
-            Kugan Vivekanandarajah  <kuganv@linaro.org>
+           Kugan Vivekanandarajah  <kuganv@linaro.org>
 
        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 (file)
index 0000000..b8c2c0e
--- /dev/null
@@ -0,0 +1,10 @@
+// { dg-do compile }
+// { dg-options "-fgnu-tm" }
+
+int a;
+int f() {
+    __transaction_atomic {
+        if (a == 5)
+            return 1;
+    }
+}
index 973782ba5a86fd832db34156dbba5d21d01c8d67..41b55acbc77d841aba47c53bf18be862681e9f83 100644 (file)
@@ -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.  */