From: Richard Guenther Date: Mon, 27 Jun 2011 14:32:00 +0000 (+0000) Subject: re PR middle-end/49394 (libstdc++-v3/testsuite/30_threads/lock_guard/cons/1.cc FAILs... X-Git-Tag: releases/gcc-4.7.0~5759 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1c86160a7a5cf82e15877d22d7e600aac9459bae;p=thirdparty%2Fgcc.git re PR middle-end/49394 (libstdc++-v3/testsuite/30_threads/lock_guard/cons/1.cc FAILs with -fipa-pta -fnon-call-exceptions) 2011-06-27 Richard Guenther PR tree-optimization/49394 * passes.c (execute_one_pass): Restore current_pass after applying IPA transforms. * g++.dg/torture/pr49394.C: New testcase. From-SVN: r175532 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c107dfd225d0..9c89885d8a3a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-06-27 Richard Guenther + + PR tree-optimization/49394 + * passes.c (execute_one_pass): Restore current_pass after + applying IPA transforms. + 2011-06-27 Kai Tietz * tree-ssa-math-opts.c (do_shift_rotate): Zero bits diff --git a/gcc/passes.c b/gcc/passes.c index a03aa3f48c01..fc9767e39ca4 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -2030,6 +2030,8 @@ execute_one_pass (struct opt_pass *pass) do_per_function (apply_ipa_transforms, (void *)&applied); if (applied) cgraph_remove_unreachable_nodes (true, dump_file); + /* Restore current_pass. */ + current_pass = pass; } if (!quiet_flag && !cfun) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 975409ec8602..7184340d0025 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-06-27 Richard Guenther + + PR tree-optimization/49394 + * g++.dg/torture/pr49394.C: New testcase. + 2011-06-27 Kai Tietz * gcc.dg/optimize-bswapdi-2.c: New test. diff --git a/gcc/testsuite/g++.dg/torture/pr49394.C b/gcc/testsuite/g++.dg/torture/pr49394.C new file mode 100644 index 000000000000..67d521f45582 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr49394.C @@ -0,0 +1,50 @@ +// { dg-do run } +// { dg-options "-fipa-pta -fnon-call-exceptions" } + +struct Mutex +{ + bool locked; + ~Mutex () + { + if (locked) + throw 0; + } + void lock () + { + locked = true; + } + void unlock () + { + if (!locked) + throw 0; + locked = false; + } +}; + +struct lock_guard +{ + Mutex *m; + lock_guard (Mutex *m) : m(m) + { + } + ~lock_guard () + { + m->unlock (); + } +}; + +int +main () +{ + Mutex m; + m.lock (); + try + { + lock_guard l (&m); + } + catch ( ...) + { + __builtin_abort (); + } + return 0; +}