Bug 965122 - Add gcc patch for PR55650, r=tbsaunde

This commit is contained in:
Mike Hommey 2014-01-29 13:02:49 +09:00
parent c1359e2176
commit 4e8f7e83d0
2 changed files with 57 additions and 1 deletions

View File

@ -2,7 +2,9 @@
gcc_version=4.7.3
binutils_version=2.23.1
gcc_bt_patch=$(readlink -f $(dirname $0))/gcc-bt.patch
this_path=$(readlink -f $(dirname $0))
gcc_bt_patch=${this_path}/gcc-bt.patch
gcc_pr55650_patch=${this_path}/gcc48-pr55650.patch
make_flags='-j12'
root_dir=$(mktemp -d)
@ -30,6 +32,8 @@ cd gcc-$gcc_version
# gcc 4.7 doesn't dump a stack on ICE so hack that in
patch -p1 < $gcc_bt_patch || exit 1
patch -p0 < $gcc_pr55650_patch || exit 1
cd ..
mkdir gcc-objdir
cd gcc-objdir

View File

@ -0,0 +1,52 @@
2012-12-12 Jakub Jelinek <jakub@redhat.com>
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.
--- gcc/coverage.c.jj 2012-11-19 14:41:24.000000000 +0100
+++ gcc/coverage.c 2012-12-12 08:54:35.005180211 +0100
@@ -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++;
--- gcc/testsuite/g++.dg/other/pr55650.C.jj 2012-12-12 09:03:53.342876593 +0100
+++ gcc/testsuite/g++.dg/other/pr55650.C 2012-12-12 09:03:11.000000000 +0100
@@ -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;
+}
--- gcc/testsuite/g++.dg/other/pr55650.cc.jj 2012-12-12 09:03:56.329858741 +0100
+++ gcc/testsuite/g++.dg/other/pr55650.cc 2012-12-12 09:03:48.982900718 +0100
@@ -0,0 +1,4 @@
+int
+main ()
+{
+}