Hi,
New auto-profile merging dumps made me notice that we read the afdo
data when we are in LTO.  This is not necessary since profile is read
at compile time and streamed to LTO bytecode.

gcc/ChangeLog:

        * coverage.cc (coverage_init): Return early when in LTO.

diff --git a/gcc/coverage.cc b/gcc/coverage.cc
index 7181e757359..c0ae76a40ef 100644
--- a/gcc/coverage.cc
+++ b/gcc/coverage.cc
@@ -1253,6 +1253,9 @@ coverage_obj_finish (vec<constructor_elt, va_gc> *ctor,
 void
 coverage_init (const char *filename)
 {
+  /* If we are in LTO, the profile will be read from object files.  */
+  if (in_lto_p)
+    return;
   const char *original_filename = filename;
   int original_len = strlen (original_filename);
 #if HAVE_DOS_BASED_FILE_SYSTEM

Reply via email to