https://gcc.gnu.org/g:41f6662fcc62b4bdfa0a2d5a4ca0e6293e9d81a6

commit r16-8545-g41f6662fcc62b4bdfa0a2d5a4ca0e6293e9d81a6
Author: Richard Biener <[email protected]>
Date:   Wed Mar 25 13:48:49 2026 +0100

    Do not read classical profile when -fauto-profile
    
    Formerly the code was
    
      if (flag_auto_profile)
        read_autofdo_file ();
      else if (flag_branch_probabilities)
        read_counts_file ();
    
    but with the AFDO re-org read_autofdo_file was delayed but the
    guard not preserved.  The following rectifies this.
    
            * coverage.cc (coverage_init): Do not call read_counts_file
            if flag_auto_profile.

Diff:
---
 gcc/coverage.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/coverage.cc b/gcc/coverage.cc
index 3d960b8608c4..5742dd921660 100644
--- a/gcc/coverage.cc
+++ b/gcc/coverage.cc
@@ -1343,7 +1343,7 @@ coverage_init (const char *filename)
   strcpy (da_file_name + prefix_len + len, GCOV_DATA_SUFFIX);
 
   bbg_file_stamp = local_tick;
-  if (flag_branch_probabilities)
+  if (flag_branch_probabilities && !flag_auto_profile)
     read_counts_file ();
 
   /* Name of bbg file.  */

Reply via email to