Patchwork Fix PR57269

login
register
mail settings
Submitter Richard Guenther
Date May 14, 2013, 9:59 a.m.
Message ID <alpine.LNX.2.00.1305141158280.24881@zhemvz.fhfr.qr>
Download mbox | patch
Permalink /patch/243654/
State New
Headers show

Comments

Richard Guenther - May 14, 2013, 9:59 a.m.
This backports a piece of Nathans patch to avoid opening two
gcov files at once (which ICEs).

Profiledbootstrap / regtest ongoing on x86_64-unknown-linux-gnu.

Richard.

2013-05-14  Richard Biener  <rguenther@suse.de>

	PR gcov-profile/57269
	Backport from mainline
	2012-06-30  Nathan Sidwell  <nathan@acm.org>

	* coverage.c (coverage_init): Read counts file before writing
	graph header.

Patch

Index: gcc/coverage.c
===================================================================
--- gcc/coverage.c	(revision 198575)
+++ gcc/coverage.c	(working copy)
@@ -1099,6 +1099,9 @@  coverage_init (const char *filename)
   memcpy (da_file_name + prefix_len, filename, len);
   strcpy (da_file_name + prefix_len + len, GCOV_DATA_SUFFIX);
 
+  if (flag_branch_probabilities)
+    read_counts_file ();
+
   /* Name of bbg file.  */
   if (flag_test_coverage && !flag_compare_debug)
     {
@@ -1118,9 +1121,6 @@  coverage_init (const char *filename)
 	  gcov_write_unsigned (local_tick);
 	}
     }
-
-  if (flag_branch_probabilities)
-    read_counts_file ();
 }
 
 /* Performs file-level cleanup.  Close graph file, generate coverage