From: Jakub Jelinek Date: Thu, 13 Dec 2012 10:11:39 +0000 (+0100) Subject: re PR gcov-profile/55650 (Firefox profiledbuild: libxul.so: cannot map zero-fill... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0f9fb22fd5e6e0611b7fb969aafe388aec70f4b2;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index eb69a551a4d..e4180a08212 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2012-12-13 Jakub Jelinek + + PR gcov-profile/55650 + * coverage.c (coverage_obj_init): Return false if no functions + are being emitted. + 2012-12-13 Steven Bosscher * bitmap.c (struct bitmap_descriptor): Remove forward declaration. diff --git a/gcc/coverage.c b/gcc/coverage.c index 7581a97f35f..cbe403a9d4e 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 e9b645db24b..f127b83b655 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2012-12-13 Jakub Jelinek + + PR gcov-profile/55650 + * g++.dg/other/pr55650.C: New test. + * g++.dg/other/pr55650.cc: New file. + 2012-12-12 Jakub Jelinek 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 00000000000..fc52b19f5d3 --- /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 00000000000..70b41462b57 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/pr55650.cc @@ -0,0 +1,4 @@ +int +main () +{ +}