]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
lto: fix usage of timer in materialize_cgraph
authorMartin Liska <mliska@suse.cz>
Wed, 23 Nov 2022 09:38:54 +0000 (10:38 +0100)
committerMartin Liska <mliska@suse.cz>
Fri, 25 Nov 2022 09:47:32 +0000 (10:47 +0100)
PR lto/107829

gcc/lto/ChangeLog:

* lto.cc (materialize_cgraph): Call timevar_push before
  materialization starts.

gcc/lto/lto.cc

index 3a9147b01b54c8596df2bf4f22d0f52ac6eb30be..3265a1d07bceaf25155beb3ed23846e446a8824a 100644 (file)
@@ -137,6 +137,12 @@ materialize_cgraph (void)
     fprintf (stderr,
             flag_wpa ? "Materializing decls:" : "Reading function bodies:");
 
+  /* Start the appropriate timer depending on the mode that we are
+     operating in.  */
+  lto_timer = (flag_wpa) ? TV_WHOPR_WPA
+             : (flag_ltrans) ? TV_WHOPR_LTRANS
+             : TV_LTO;
+  timevar_push (lto_timer);
 
   FOR_EACH_FUNCTION (node)
     {
@@ -147,14 +153,6 @@ materialize_cgraph (void)
        }
     }
 
-
-  /* Start the appropriate timer depending on the mode that we are
-     operating in.  */
-  lto_timer = (flag_wpa) ? TV_WHOPR_WPA
-             : (flag_ltrans) ? TV_WHOPR_LTRANS
-             : TV_LTO;
-  timevar_push (lto_timer);
-
   current_function_decl = NULL;
   set_cfun (NULL);