summaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2003-09-22 06:59:51 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2003-09-22 06:59:51 +0000
commit92770800d2e25d2f2f31b10090229afd3ef94951 (patch)
tree617ef40caca7262bca17e44852b596b9b9383ef0 /gcc/testsuite
parent9a557b44aa0f5381cde0b8f65006061d2f61ea66 (diff)
downloadgcc-92770800d2e25d2f2f31b10090229afd3ef94951.tar.gz
PR target/9786
* reg-stack.c (convert_regs_1): Purge possible dead eh edges after potential deletion of trapping insn. Avoids later ICE from call to fixup_abnormal_edges. (convert_regs_2): Stack the current block successors before processing this block, that is, before the potential deletion of dead edges by convert_regs_1, because these edges have been used to initialize the predecessors count. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@71644 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/g++.dg/opt/reg-stack2.C34
2 files changed, 38 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 11c7cff5343..5c9c984ed45 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2003-09-22 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * g++.dg/opt/reg-stack2.C: New test.
+
2003-09-21 Christian Ehrhardt <ehrhardt@mathematik.uni-ulm.de>
* g++.dg/eh/delayslot1.C: New test.
diff --git a/gcc/testsuite/g++.dg/opt/reg-stack2.C b/gcc/testsuite/g++.dg/opt/reg-stack2.C
new file mode 100644
index 00000000000..08cd590b471
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/reg-stack2.C
@@ -0,0 +1,34 @@
+// PR target/9786
+// Origin: <nick@ilm.com>
+
+// This used to fail on x86 because the reg-stack pass deleted
+// an insn that could seemingly trap (but actually doesn't)
+// without updating the CFG.
+
+// { dg-do compile }
+// { dg-options "-O2 -fnon-call-exceptions" }
+
+struct D1 {
+ float l;
+ D1 GS() const {D1 d;float f=.299*l;d.l=f;return d;}
+ static D1 G() {return D1();}
+};
+
+struct D2 {
+ D1 g;
+ D2(const D1& gi) : g(gi) {}
+ D2 GS() const {return D2(g.GS());}
+};
+
+class A {
+ public:
+ virtual ~A() {}
+};
+
+class B : public A {
+ public:
+ B(const D2& mi);
+ D2 fm;
+};
+
+B::B(const D2 &mi) : fm(mi.GS()) {}