aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/torture/pr93273.C12
-rw-r--r--gcc/tree-eh.c4
4 files changed, 28 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e0c961d..0ad4e97 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2020-01-15 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/93273
+ * tree-eh.c (sink_clobbers): If we already visited the destination
+ block do not defer insertion.
+ (pass_lower_eh_dispatch::execute): Maintain BB_VISITED for
+ the purpose of defered insertion.
+
2020-01-15 Jakub Jelinek <jakub@redhat.com>
* BASE-VER: Bump to 10.0.1.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 0f0f177..da638d3 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2020-01-15 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/93273
+ * g++.dg/torture/pr93273.C: New testcase.
+
2020-01-15 Richard Sandiford <richard.sandiford@arm.com>
PR tree-optimization/93247
diff --git a/gcc/testsuite/g++.dg/torture/pr93273.C b/gcc/testsuite/g++.dg/torture/pr93273.C
new file mode 100644
index 0000000..229642b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr93273.C
@@ -0,0 +1,12 @@
+// { dg-do compile }
+
+void _setjmp(void *);
+struct S { ~S(); };
+void * (* fn)();
+void f();
+void g()
+{
+ S s;
+ _setjmp(fn());
+ []{ f(); }();
+}
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c
index dc80f57..454b22c 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -3622,7 +3622,7 @@ sink_clobbers (basic_block bb,
gimple *first_sunk = NULL;
gimple *last_sunk = NULL;
- if (sunk)
+ if (sunk && !(succbb->flags & BB_VISITED))
dgsi = gsi_start (sunk[succbb->index]);
else
dgsi = gsi_after_labels (succbb);
@@ -3910,6 +3910,7 @@ pass_lower_eh_dispatch::execute (function *fun)
else if (!any_resx_to_process)
sink_clobbers (bb, NULL, &any_resx_to_process);
}
+ bb->flags &= ~BB_VISITED;
}
if (redirected)
{
@@ -3940,6 +3941,7 @@ pass_lower_eh_dispatch::execute (function *fun)
gsi_insert_seq_before (&gsi, sunk[bb->index], GSI_NEW_STMT);
sunk[bb->index] = NULL;
}
+ bb->flags |= BB_VISITED;
}
free (rpo);
free (sunk);