re PR middle-end/49394 (libstdc++-v3/testsuite/30_threads/lock_guard/cons/1.cc FAILs...
authorRichard Guenther <rguenther@suse.de>
Mon, 27 Jun 2011 14:32:00 +0000 (14:32 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 27 Jun 2011 14:32:00 +0000 (14:32 +0000)
2011-06-27  Richard Guenther  <rguenther@suse.de>

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
gcc/passes.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/torture/pr49394.C [new file with mode: 0644]

index c107dfd225d0a0b1b3e8c6e7d1e9062f742cdce4..9c89885d8a3a4d9938c0a5b2faf2e9fb6aab5762 100644 (file)
@@ -1,3 +1,9 @@
+2011-06-27  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/49394
+       * passes.c (execute_one_pass): Restore current_pass after
+       applying IPA transforms.
+
 2011-06-27  Kai Tietz  <ktietz@redhat.com>
 
        * tree-ssa-math-opts.c (do_shift_rotate): Zero bits
index a03aa3f48c0120e7890a822186a070703f84c30b..fc9767e39ca453a9d9b7ab360cf46e735f8f80b1 100644 (file)
@@ -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)
index 975409ec860277e3180c382a02c718b6cc673abf..7184340d0025c42e3f732e91f2d955ea3e7186a4 100644 (file)
@@ -1,3 +1,8 @@
+2011-06-27  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/49394
+       * g++.dg/torture/pr49394.C: New testcase.
+
 2011-06-27  Kai Tietz  <ktietz@redhat.com>
 
        * 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 (file)
index 0000000..67d521f
--- /dev/null
@@ -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;
+}