re PR c++/52248 (timevar ICE)
authorJason Merrill <jason@redhat.com>
Fri, 17 Feb 2012 08:36:53 +0000 (03:36 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 17 Feb 2012 08:36:53 +0000 (03:36 -0500)
PR c++/52248
* decl.c (define_label): Use timevar_cond_start/stop.

From-SVN: r184329

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/timevar1.C [new file with mode: 0644]

index c6bf817c5fd1b1bfd7831b9ba33e9fdf211422ba..faa85939428a266e0751b21b0816aa006ad0fa06 100644 (file)
@@ -1,3 +1,8 @@
+2012-02-16  Jason Merrill  <jason@redhat.com>
+
+       PR c++/52248
+       * decl.c (define_label): Use timevar_cond_start/stop.
+
 2012-02-16  Fabien ChĂȘne  <fabien@gcc.gnu.org>
 
        PR c++/52126
index 90746a5c9fed17ed513a492c35bcfeec5fb0c2f1..2a6a5160fb6b6189bc01b03058c66dfd305b399a 100644 (file)
@@ -2947,9 +2947,9 @@ tree
 define_label (location_t location, tree name)
 {
   tree ret;
-  timevar_start (TV_NAME_LOOKUP);
+  bool running = timevar_cond_start (TV_NAME_LOOKUP);
   ret = define_label_1 (location, name);
-  timevar_stop (TV_NAME_LOOKUP);
+  timevar_cond_stop (TV_NAME_LOOKUP, running);
   return ret;
 }
 
index 72f9f745d744d5c0dae90f15ce618d828870a95a..2f5544b172263c1ab5ca6042bf6c6d2f2a4db2d1 100644 (file)
@@ -1,3 +1,8 @@
+2012-02-16  Jason Merrill  <jason@redhat.com>
+
+       PR c++/52248
+       * g++.dg/ext/timevar1.C: New.
+
 2012-02-16  Fabien ChĂȘne  <fabien@gcc.gnu.org>
 
        PR c++/52126
diff --git a/gcc/testsuite/g++.dg/ext/timevar1.C b/gcc/testsuite/g++.dg/ext/timevar1.C
new file mode 100644 (file)
index 0000000..0d2d3f5
--- /dev/null
@@ -0,0 +1,12 @@
+// PR c++/52248
+// { dg-options "-ftime-report" }
+// { dg-prune-output "wall" }
+// { dg-prune-output "times" }
+// { dg-prune-output "TOTAL" }
+// { dg-prune-output "checks" }
+
+void
+foo ()
+{
+  goto lab;                    // { dg-error "not defined" }
+}