aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2012-12-13 11:11:39 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2012-12-13 11:11:39 +0100
commit0f9fb22fd5e6e0611b7fb969aafe388aec70f4b2 (patch)
tree792cd3bc067f7c473764f2d4245c86593b6a2885 /gcc
parent3c53f55a97cc10a3cc4e4dabe9e90f98537baf33 (diff)
downloadgcc-0f9fb22fd5e6e0611b7fb969aafe388aec70f4b2.zip
gcc-0f9fb22fd5e6e0611b7fb969aafe388aec70f4b2.tar.gz
gcc-0f9fb22fd5e6e0611b7fb969aafe388aec70f4b2.tar.bz2
re PR gcov-profile/55650 (Firefox profiledbuild: libxul.so: cannot map zero-fill pages: Cannot allocate memory)
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/coverage.c3
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/g++.dg/other/pr55650.C21
-rw-r--r--gcc/testsuite/g++.dg/other/pr55650.cc4
5 files changed, 40 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index eb69a55..e4180a0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/coverage.c b/gcc/coverage.c
index 7581a97..cbe403a 100644
--- a/gcc/coverage.c
+++ b/gcc/coverage.c
@@ -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++;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index e9b645d..f127b83 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 0000000..fc52b19
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/pr55650.C
@@ -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
index 0000000..70b4146
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/pr55650.cc
@@ -0,0 +1,4 @@
+int
+main ()
+{
+}