1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/build/unix/build-gcc/gcc48-pr55650.patch Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,52 @@ 1.4 +2012-12-12 Jakub Jelinek <jakub@redhat.com> 1.5 + 1.6 + PR gcov-profile/55650 1.7 + * coverage.c (coverage_obj_init): Return false if no functions 1.8 + are being emitted. 1.9 + 1.10 + * g++.dg/other/pr55650.C: New test. 1.11 + * g++.dg/other/pr55650.cc: New file. 1.12 + 1.13 +--- gcc/coverage.c.jj 2012-11-19 14:41:24.000000000 +0100 1.14 ++++ gcc/coverage.c 2012-12-12 08:54:35.005180211 +0100 1.15 +@@ -999,6 +999,9 @@ coverage_obj_init (void) 1.16 + /* The function is not being emitted, remove from list. */ 1.17 + *fn_prev = fn->next; 1.18 + 1.19 ++ if (functions_head == NULL) 1.20 ++ return false; 1.21 ++ 1.22 + for (ix = 0; ix != GCOV_COUNTERS; ix++) 1.23 + if ((1u << ix) & prg_ctr_mask) 1.24 + n_counters++; 1.25 +--- gcc/testsuite/g++.dg/other/pr55650.C.jj 2012-12-12 09:03:53.342876593 +0100 1.26 ++++ gcc/testsuite/g++.dg/other/pr55650.C 2012-12-12 09:03:11.000000000 +0100 1.27 +@@ -0,0 +1,21 @@ 1.28 ++// PR gcov-profile/55650 1.29 ++// { dg-do link } 1.30 ++// { dg-options "-O2 -fprofile-generate" } 1.31 ++// { dg-additional-sources "pr55650.cc" } 1.32 ++ 1.33 ++struct A 1.34 ++{ 1.35 ++ virtual void foo (); 1.36 ++}; 1.37 ++ 1.38 ++struct B : public A 1.39 ++{ 1.40 ++ B (); 1.41 ++ void foo () {} 1.42 ++}; 1.43 ++ 1.44 ++inline A * 1.45 ++bar () 1.46 ++{ 1.47 ++ return new B; 1.48 ++} 1.49 +--- gcc/testsuite/g++.dg/other/pr55650.cc.jj 2012-12-12 09:03:56.329858741 +0100 1.50 ++++ gcc/testsuite/g++.dg/other/pr55650.cc 2012-12-12 09:03:48.982900718 +0100 1.51 +@@ -0,0 +1,4 @@ 1.52 ++int 1.53 ++main () 1.54 ++{ 1.55 ++}