From 1c86160a7a5cf82e15877d22d7e600aac9459bae Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Mon, 27 Jun 2011 14:32:00 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 6 ++++ gcc/passes.c | 2 ++ gcc/testsuite/ChangeLog | 5 +++ gcc/testsuite/g++.dg/torture/pr49394.C | 50 ++++++++++++++++++++++++++ 4 files changed, 63 insertions(+) create mode 100644 gcc/testsuite/g++.dg/torture/pr49394.C diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c107dfd225d..9c89885d8a3 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 a03aa3f48c0..fc9767e39ca 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 975409ec860..7184340d002 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 00000000000..67d521f4558 --- /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; +} -- 2.30.2