Bug 965122 - Add gcc patch for PR55650, r=tbsaunde
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 29 Jan 2014 13:02:49 +0900
changeset 182514 cdc7a6424a0d2f2a7ca801e21e1229e02ad5c56d
parent 182513 6199eb8d2f3e2fb19a51c9084df5e19f597599a6
child 182515 4cddbc0d518340713b826a48689a534eaebc64e8
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstbsaunde
bugs965122
milestone29.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 965122 - Add gcc patch for PR55650, r=tbsaunde
build/unix/build-gcc/build-gcc.sh
build/unix/build-gcc/gcc48-pr55650.patch
--- a/build/unix/build-gcc/build-gcc.sh
+++ b/build/unix/build-gcc/build-gcc.sh
@@ -1,13 +1,15 @@
 #!/bin/bash
 
 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)
 cd $root_dir
 
 if test -z $TMPDIR; then
   TMPDIR=/tmp/
 fi
@@ -25,16 +27,18 @@ cd ..
 tar xjf $TMPDIR/gcc-$gcc_version.tar.bz2
 cd gcc-$gcc_version
 
 ./contrib/download_prerequisites
 
 # 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
 ../gcc-$gcc_version/configure --prefix=/tools/gcc --enable-languages=c,c++  --disable-nls --disable-gnu-unique-object --enable-__cxa_atexit --with-arch-32=pentiumpro || exit 1
 make $make_flags || exit 1
 make $make_flags install DESTDIR=$root_dir || exit 1
 
 cd $root_dir/tools
new file mode 100644
--- /dev/null
+++ b/build/unix/build-gcc/gcc48-pr55650.patch
@@ -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 ()
++{
++}