From: Martin Liska Date: Wed, 23 Nov 2022 09:38:54 +0000 (+0100) Subject: lto: fix usage of timer in materialize_cgraph X-Git-Tag: basepoints/gcc-14~2911 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b3a3d7fe3420b6b49810b2a7f5d120c53310335;p=thirdparty%2Fgcc.git lto: fix usage of timer in materialize_cgraph PR lto/107829 gcc/lto/ChangeLog: * lto.cc (materialize_cgraph): Call timevar_push before materialization starts. --- diff --git a/gcc/lto/lto.cc b/gcc/lto/lto.cc index 3a9147b01b54..3265a1d07bce 100644 --- a/gcc/lto/lto.cc +++ b/gcc/lto/lto.cc @@ -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);