re PR gcov-profile/55650 (Firefox profiledbuild: libxul.so: cannot map zero-fill...
authorJakub Jelinek <jakub@redhat.com>
Thu, 13 Dec 2012 10:11:39 +0000 (11:11 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 13 Dec 2012 10:11:39 +0000 (11:11 +0100)
PR gcov-profile/55650
* coverage.c (coverage_obj_init): Return false if no functions
are being emitted.

* g++.dg/other/pr55650.C: New test.
* g++.dg/other/pr55650.cc: New file.

From-SVN: r194470

gcc/ChangeLog
gcc/coverage.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/pr55650.C [new file with mode: 0644]
gcc/testsuite/g++.dg/other/pr55650.cc [new file with mode: 0644]

index eb69a551a4de060a0fe3146da005bdf1276341ab..e4180a08212af14afdfe27e1584cd4110b5158fe 100644 (file)
@@ -1,3 +1,9 @@
+2012-12-13  Jakub Jelinek  <jakub@redhat.com>
+
+       PR gcov-profile/55650
+       * coverage.c (coverage_obj_init): Return false if no functions
+       are being emitted.
+
 2012-12-13  Steven Bosscher  <steven@gcc.gnu.org>
 
        * bitmap.c (struct bitmap_descriptor): Remove forward declaration.
index 7581a97f35f9162814d2186dbec503453fb31d05..cbe403a9d4e04d1f3837d7838c28258cb618f4c4 100644 (file)
@@ -999,6 +999,9 @@ coverage_obj_init (void)
       /* The function is not being emitted, remove from list.  */
       *fn_prev = fn->next;
 
+  if (functions_head == NULL)
+    return false;
+
   for (ix = 0; ix != GCOV_COUNTERS; ix++)
     if ((1u << ix) & prg_ctr_mask)
       n_counters++;
index e9b645db24b221dfb25497a9a6992aba87a5a0a2..f127b83b65553884756aca8b0265caf9c0f1c0e9 100644 (file)
@@ -1,3 +1,9 @@
+2012-12-13  Jakub Jelinek  <jakub@redhat.com>
+
+       PR gcov-profile/55650
+       * g++.dg/other/pr55650.C: New test.
+       * g++.dg/other/pr55650.cc: New file.
+
 2012-12-12  Jakub Jelinek  <jakub@redhat.com>
 
        PR debug/55665
diff --git a/gcc/testsuite/g++.dg/other/pr55650.C b/gcc/testsuite/g++.dg/other/pr55650.C
new file mode 100644 (file)
index 0000000..fc52b19
--- /dev/null
@@ -0,0 +1,21 @@
+// PR gcov-profile/55650
+// { dg-do link }
+// { dg-options "-O2 -fprofile-generate" }
+// { dg-additional-sources "pr55650.cc" }
+
+struct A
+{
+  virtual void foo ();
+};
+
+struct B : public A
+{
+  B ();
+  void foo () {}
+};
+
+inline A *
+bar ()
+{
+  return new B;
+}
diff --git a/gcc/testsuite/g++.dg/other/pr55650.cc b/gcc/testsuite/g++.dg/other/pr55650.cc
new file mode 100644 (file)
index 0000000..70b4146
--- /dev/null
@@ -0,0 +1,4 @@
+int
+main ()
+{
+}