Patchwork : Fix -fbranch-probabilities

login
register
mail settings
Submitter Christian Bruel
Date Aug. 12, 2011, 1:59 p.m.
Message ID <4E4531A4.8000402@st.com>
Download mbox | patch
Permalink /patch/109840/
State New
Headers show

Comments

Christian Bruel - Aug. 12, 2011, 1:59 p.m.
Hello,

-fbranch-probabilities fails to find the gcda information, because they 
are initialized only if flag_profile_use.

The problem is easily observable by recompiling with 
-fbranch-probabilities instead of -fprofile-use (after profile 
information generation)
This fails with "xxx.gcda not found, execution counts estimated".

This trivial patch fixes it. testsuite ok.

OK ?

Christian

Patch

2011-08-12  Christian Bruel  <christian.bruel@st.com>

	* coverage.c (coverage_init): Check flag_branch_probabilities instead of
	flag_profile_use.
	
Index: gcc/coverage.c
===================================================================
--- gcc/coverage.c	(revision 177690)
+++ gcc/coverage.c	(working copy)
@@ -1056,7 +1056,7 @@ 
   strcpy (bbg_file_name, filename);
   strcat (bbg_file_name, GCOV_NOTE_SUFFIX);
 
-  if (flag_profile_use)
+  if (flag_branch_probabilities)
     read_counts_file ();
 }