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 <ja...@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