This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[committed] Add a testcase for PR tree-optimization/51117
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 15 Dec 2011 18:34:01 +0100
- Subject: [committed] Add a testcase for PR tree-optimization/51117
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
I've committed a testcase that I wrote in the PR51117 clobber
sinking thread, after regtesting on x86_64-linux and i686-linux.
2011-12-15 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/51117
* g++.dg/opt/pr51117.C: New test.
--- gcc/testsuite/g++.dg/opt/pr51117.C.jj 2011-12-15 12:19:29.278552435 +0100
+++ gcc/testsuite/g++.dg/opt/pr51117.C 2011-12-15 12:19:02.569708102 +0100
@@ -0,0 +1,37 @@
+// PR tree-optimization/51117
+// { dg-do compile }
+// { dg-options "-O2 -fexceptions" }
+
+struct A { char buf[64]; };
+void bar (A *);
+
+int
+foo ()
+{
+ A c;
+ bar (&c);
+ try
+ {
+ {
+ A a;
+ bar (&a);
+ if (a.buf[13])
+ throw 1;
+ else if (a.buf[52])
+ throw 3;
+ }
+ {
+ A b;
+ bar (&b);
+ if (b.buf[13])
+ throw 2;
+ }
+ }
+ catch ( ...)
+ {
+ return 1;
+ }
+ return 0;
+}
+
+// { dg-final { scan-assembler-not "__cxa_rethrow" } }
Jakub