aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/stmt.c6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/torture/pr82154.C50
4 files changed, 65 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7bba8a9..959e04e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2017-09-13 Martin Liska <mliska@suse.cz>
+
+ PR middle-end/82154
+ * stmt.c (expand_sjlj_dispatch_table): Use CASE_LOW when
+ CASE_HIGH is NULL_TREE.
+
2017-09-13 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 39d29ff..92bd209 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -1063,8 +1063,10 @@ expand_sjlj_dispatch_table (rtx dispatch_index,
for (int i = ncases - 1; i >= 0; --i)
{
tree elt = dispatch_table[i];
- case_list.safe_push (simple_case_node (CASE_LOW (elt),
- CASE_HIGH (elt),
+ tree high = CASE_HIGH (elt);
+ if (high == NULL_TREE)
+ high = CASE_LOW (elt);
+ case_list.safe_push (simple_case_node (CASE_LOW (elt), high,
CASE_LABEL (elt)));
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 71e2b36..4084e1c 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2017-09-13 Martin Liska <mliska@suse.cz>
+
+ PR middle-end/82154
+ * g++.dg/torture/pr82154.C: New test.
+
2017-09-13 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/61362
diff --git a/gcc/testsuite/g++.dg/torture/pr82154.C b/gcc/testsuite/g++.dg/torture/pr82154.C
new file mode 100644
index 0000000..f4e1c3e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr82154.C
@@ -0,0 +1,50 @@
+// { dg-do compile }
+// { dg-additional-options "-Wno-deprecated" }
+
+namespace a {
+int b;
+class c
+{
+};
+}
+class g
+{
+public:
+ g ();
+};
+using a::b;
+class d
+{
+public:
+ d ();
+ void e ();
+};
+class f
+{
+ d
+ i ()
+ {
+ static d j;
+ }
+ int *k () throw (a::c);
+};
+
+
+int *f::k () throw (a::c)
+{
+ static g h;
+ i ();
+ int l = 2;
+ while (l)
+ {
+ --l;
+ try
+ {
+ operator new (b);
+ }
+ catch (a::c)
+ {
+ }
+ }
+ i ().e ();
+}