OSDN Git Service

PR c++/52248
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 17 Feb 2012 08:36:53 +0000 (08:36 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 17 Feb 2012 08:36:53 +0000 (08:36 +0000)
* decl.c (define_label): Use timevar_cond_start/stop.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184329 138bc75d-0d04-0410-961f-82ee72b054a4

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

index c6bf817..faa8593 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 90746a5..2a6a516 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 72f9f74..2f5544b 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" }
+}