From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by sourceware.org (Postfix) with ESMTPS id 6B8A53858D32 for ; Mon, 15 May 2023 07:30:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6B8A53858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2acb6571922so108849281fa.0 for ; Mon, 15 May 2023 00:30:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684135848; x=1686727848; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=r/P2sOCZw+vRpF/8Lg7BNb6MMdlNWV0KF6KmlvY1bwU=; b=Uz8vzKnvzrA0hqT+91qioDRH5lIMBrB5hqi6+z92fJsxYGr7JoST4XHsLk/TKXShoP TNB1Wc+fAC3YSWom37Y2mlQEoP0ca07lzkKbrmQnLF2yMBzZQ4KAziUCuX7igxH67kpD WQUlvrDxJKBNumVUsDTXAl3tyJi3Y5Aot5Fb7PoI6cEZObglFjQstot5BAqGDeKMpzCp qdA9sWgHQ/SqiKrZ753E0ZFMSrU6ekSFHAtSj8i1n300uNnjUeoKz3AsT2ue2gOeMyfq 2ttJWaLTRZ/lu0fPWwPyPR9Th3vFmjhwzzpMfPyuqupO0ckQrxSxs9Wwl+h6WxBatiVG 5ZFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684135848; x=1686727848; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=r/P2sOCZw+vRpF/8Lg7BNb6MMdlNWV0KF6KmlvY1bwU=; b=kuOYxQMl5oysL6x6bay3idGAnwTtLxhVBVfHLAozY7AaFFQKFOQXoRZtJ/IfSjIuUh lP9fQ1BDXTkvdn78NObdyVc9KPC2sd70nQfLgDlLtV9uRMadRqyxM5XZ4Ut1YEQAdBrv HoTXH6JFpZuYKmQyYN+Z6t9m+vgRp3zEOcgewkEjwe77cHUTlAYLPIZug+q10xyvn2SO STyLNxueUmkRA7Fh8FJ09deBD05+b70JIjbepOPPFjQOHIdNZn2EXjBBZS5kxhiZd5/j +hFoYdjkP0IE40k4RjbC385+4paucgYFmSRXy7uiN/WjJOnRl+NlGvjit8HEIA2S+ZeP M9hQ== X-Gm-Message-State: AC+VfDxUrlny1oca7Vz+5kFdnojYfpxpKvUFKU3BEemLAYXJsKYE3ygS /I7HNaJhcwiEBb635foRcujBSLPyJGNK30XFD2M= X-Google-Smtp-Source: ACHHUZ6OGbSeb2fyJa9s47ysxlR74CU8iZOvnAzQ2JmAzNtxWIqMYfJbkfPO/AjuselHzZzKRmPW/Ixw+ddVs+Hi5JM= X-Received: by 2002:a2e:9d4d:0:b0:2a8:d13d:88fb with SMTP id y13-20020a2e9d4d000000b002a8d13d88fbmr6393435ljj.11.1684135847465; Mon, 15 May 2023 00:30:47 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Richard Biener Date: Mon, 15 May 2023 09:30:35 +0200 Message-ID: Subject: Re: [EXTERNAL] Re: [PATCH] Fixes and workarounds for warnings during autoprofiledbootstrap build To: Eugene Rozenfeld Cc: "gcc-patches@gcc.gnu.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, May 12, 2023 at 10:35=E2=80=AFPM Eugene Rozenfeld wrote: > > Thank you, Richard. I went with your suggestion. New patch: > > > [PATCH] Disable warnings as errors for STAGEautofeedback. > > Compilation during STAGEautofeedback produces additional warnings > since inlining decisions with -fauto-profile are different from > other builds. > > This patches disables warnings as errors for STAGEautofeedback. Can you add a comment before the filtering? Otherwise looks good to me - please leave others 24h to comment before you commit. Thanks, Richard. > Tested on x86_64-pc-linux-gnu. > > ChangeLog: > > * Makefile.in: Disable warnings as errors for STAGEautofeedback > --- > Makefile.in | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/Makefile.in b/Makefile.in > index 33f3c862557..4c14c73ea61 100644 > --- a/Makefile.in > +++ b/Makefile.in > @@ -590,8 +590,7 @@ STAGEautofeedback_CXXFLAGS =3D $(CXXFLAGS) > STAGEautofeedback_CXXFLAGS =3D $(STAGEautofeedback_CFLAGS) > @endif target-libstdc++-v3-bootstrap > STAGEautofeedback_TFLAGS =3D $(STAGE_TFLAGS) > -STAGEautofeedback_CONFIGURE_FLAGS =3D $(STAGE_CONFIGURE_FLAGS) > - > +STAGEautofeedback_CONFIGURE_FLAGS =3D $(filter-out --enable-werror-alway= s,$(STAGE_CONFIGURE_FLAGS)) > > # By default, C and C++ are the only stage1 languages, because they are = the > # only ones we require to build with the bootstrap compiler, and also th= e > -- > 2.25.1 > > Thanks, > > Eugene > > -----Original Message----- > From: Richard Biener > Sent: Thursday, May 11, 2023 1:58 AM > To: Eugene Rozenfeld > Cc: gcc-patches@gcc.gnu.org > Subject: Re: [EXTERNAL] Re: [PATCH] Fixes and workarounds for warnings du= ring autoprofiledbootstrap build > > On Thu, May 11, 2023 at 4:23=E2=80=AFAM Eugene Rozenfeld wrote: > > > > I'm ok with disabling warnings as errors for autoprofiledbootstrap. Wha= t's the proper way to do that? Searching for "--disable-werror" I see match= es in lib configure files but not in gcc files. > > We have --with-build-config selecting things like bootstrap-O3 and config= ure then disables werror by default if the build config is anything other t= han the default or bootstrap-debug. > > Of course profiledbootstrap and autoprofiledbootstrap are not build confi= gs but make targets - that makes it more difficult (or impossible) to use t= he --disable-werror machinery here. > > There is > > STAGE_CONFIGURE_FLAGS=3D@stage2_werror_flag@ > > so it might be possible to filter out --enable-werror-always from STAGEau= tofeedback_CONFIGURE_FLAGS? > > Richard. > > > Thanks, > > > > Eugene > > > > -----Original Message----- > > From: Richard Biener > > Sent: Tuesday, May 9, 2023 11:40 PM > > To: Eugene Rozenfeld > > Cc: gcc-patches@gcc.gnu.org > > Subject: [EXTERNAL] Re: [PATCH] Fixes and workarounds for warnings > > during autoprofiledbootstrap build > > > > On Wed, May 10, 2023 at 3:38=E2=80=AFAM Eugene Rozenfeld via Gcc-patche= s wrote: > > > > > > autoprofiledbootstrap build produces new warnings since inlining > > > decisions are different from other builds. This patch contains fixes > > > and workarounds for those warnings. > > > > > > Tested on x86_64-pc-linux-gnu. > > > > Rather than this would it make sense to add --disable-werror to autopro= filedbootstrap configs like we do for others? I also wonder how "stable" t= he afdo bootstrap inlining decisions are, so applying these workarounds may= not be sustainable? > > > > > gcc/ChangeLog: > > > > > > * config/i386/i386-expand.cc (expand_vec_perm_interleave2): W= ork around > > > -Wstringop-overflow false positive during autoprofiledbootstr= ap > > > * ipa-devirt.cc (debug_tree_odr_name): Fix for -Wformat-overf= low > > > warning during autoprofiledbootstrap > > > * lra-eliminations.cc (setup_can_eliminate): Work around > > > -Wmaybe-uninitialized false positive during autoprofiledboots= trap > > > * opts-common.cc (candidates_list_and_hint): Work around > > > -Wstringop-overflow false positive during autoprofiledbootstr= ap > > > * tree-ssa-ccp.cc (bit_value_unop): Work around -Wmaybe-unini= tialized > > > false positive during autoprofiledbootstrap > > > * wide-int.h (wi::copy): Work around -Wmaybe-uninitialized fa= lse > > > positive during autoprofiledbootstrap > > > --- > > > gcc/config/i386/i386-expand.cc | 11 +++++++++++ > > > gcc/ipa-devirt.cc | 3 ++- > > > gcc/lra-eliminations.cc | 11 +++++++++++ > > > gcc/opts-common.cc | 1 + > > > gcc/tree-ssa-ccp.cc | 11 +++++++++++ > > > gcc/wide-int.h | 11 +++++++++++ > > > 6 files changed, 47 insertions(+), 1 deletion(-) > > > > > > diff --git a/gcc/config/i386/i386-expand.cc > > > b/gcc/config/i386/i386-expand.cc index 634fe61ba79..be9f912775b > > > 100644 > > > --- a/gcc/config/i386/i386-expand.cc > > > +++ b/gcc/config/i386/i386-expand.cc > > > @@ -20419,6 +20419,13 @@ expand_vec_perm_pblendv (struct > > > expand_vec_perm_d *d) > > > > > > static bool expand_vec_perm_interleave3 (struct expand_vec_perm_d > > > *d); > > > > > > +/* Work around -Wstringop-overflow false positive during > > > +autoprofiledbootstrap. */ > > > + > > > +# if GCC_VERSION >=3D 7001 > > > +#pragma GCC diagnostic push > > > +#pragma GCC diagnostic ignored "-Wstringop-overflow" > > > +#endif > > > + > > > /* A subroutine of ix86_expand_vec_perm_const_1. Try to simplify > > > a two vector permutation into a single vector permutation by usin= g > > > an interleave operation to merge the vectors. */ @@ -20737,6 > > > +20744,10 @@ expand_vec_perm_interleave2 (struct expand_vec_perm_d > > > +*d) > > > return true; > > > } > > > > > > +# if GCC_VERSION >=3D 7001 > > > +#pragma GCC diagnostic pop > > > +#endif > > > + > > > /* A subroutine of ix86_expand_vec_perm_const_1. Try to simplify > > > a single vector cross-lane permutation into vpermq followed > > > by any of the single insn permutations. */ diff --git > > > a/gcc/ipa-devirt.cc b/gcc/ipa-devirt.cc index > > > 819860258d1..36ea266e834 > > > 100644 > > > --- a/gcc/ipa-devirt.cc > > > +++ b/gcc/ipa-devirt.cc > > > @@ -4033,7 +4033,8 @@ debug_tree_odr_name (tree type, bool demangle) > > > odr =3D cplus_demangle (odr, opts); > > > } > > > > > > - fprintf (stderr, "%s\n", odr); > > > + if (odr !=3D NULL) > > > + fprintf (stderr, "%s\n", odr); > > > } > > > > > > /* Register ODR enum so we later stream record about its values. > > > */ diff --git a/gcc/lra-eliminations.cc b/gcc/lra-eliminations.cc > > > index > > > 42206366669..05e2a7e0d68 100644 > > > --- a/gcc/lra-eliminations.cc > > > +++ b/gcc/lra-eliminations.cc > > > @@ -138,6 +138,13 @@ lra_debug_elim_table (void) > > > print_elim_table (stderr); > > > } > > > > > > +/* Work around -Wmaybe-uninitialized false positive during > > > +autoprofiledbootstrap. */ > > > + > > > +# if GCC_VERSION >=3D 4007 > > > +#pragma GCC diagnostic push > > > +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" > > > +#endif > > > + > > > /* Setup possibility of elimination in elimination table element EP = to > > > VALUE. Setup FRAME_POINTER_NEEDED if elimination from frame > > > pointer to stack pointer is not possible anymore. */ @@ -152,6 > > > +159,10 @@ setup_can_eliminate (class lra_elim_table *ep, bool > > > +value) > > > REGNO_POINTER_ALIGN (HARD_FRAME_POINTER_REGNUM) =3D 0; } > > > > > > +# if GCC_VERSION >=3D 4007 > > > +#pragma GCC diagnostic pop > > > +#endif > > > + > > > /* Map: eliminable "from" register -> its current elimination, > > > or NULL if none. The elimination table may contain more than > > > one elimination for the same hard register, but this map > > > specifies diff --git a/gcc/opts-common.cc b/gcc/opts-common.cc index > > > 23ddcaa3b55..0bb8e34e2b0 100644 > > > --- a/gcc/opts-common.cc > > > +++ b/gcc/opts-common.cc > > > @@ -1388,6 +1388,7 @@ candidates_list_and_hint (const char *arg, char= *&str, > > > p[len] =3D ' '; > > > p +=3D len + 1; > > > } > > > + gcc_assert(p > str); > > > p[-1] =3D '\0'; > > > return find_closest_string (arg, &candidates); } diff --git > > > a/gcc/tree-ssa-ccp.cc b/gcc/tree-ssa-ccp.cc index > > > 03a984f2adf..a54e5a90464 100644 > > > --- a/gcc/tree-ssa-ccp.cc > > > +++ b/gcc/tree-ssa-ccp.cc > > > @@ -1976,6 +1976,13 @@ bit_value_binop (enum tree_code code, signop s= gn, int width, > > > } > > > } > > > > > > +/* Work around -Wmaybe-uninitialized false positive during > > > +autoprofiledbootstrap. */ > > > + > > > +# if GCC_VERSION >=3D 4007 > > > +#pragma GCC diagnostic push > > > +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" > > > +#endif > > > + > > > /* Return the propagation value when applying the operation CODE to > > > the value RHS yielding type TYPE. */ > > > > > > @@ -2011,6 +2018,10 @@ bit_value_unop (enum tree_code code, tree type= , tree rhs) > > > return val; > > > } > > > > > > +# if GCC_VERSION >=3D 4007 > > > +#pragma GCC diagnostic pop > > > +#endif > > > + > > > /* Return the propagation value when applying the operation CODE to > > > the values RHS1 and RHS2 yielding type TYPE. */ > > > > > > diff --git a/gcc/wide-int.h b/gcc/wide-int.h index > > > 6be343c0eb5..9c50dd869b6 100644 > > > --- a/gcc/wide-int.h > > > +++ b/gcc/wide-int.h > > > @@ -1806,6 +1806,13 @@ wi::get_binary_precision (const T1 &x, const T= 2 &y) > > > get_binary_result (x, y)); } > > > > > > +/* Work around -Wmaybe-uninitialized false positive during > > > +autoprofiledbootstrap. */ > > > + > > > +# if GCC_VERSION >=3D 4007 > > > +#pragma GCC diagnostic push > > > +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" > > > +#endif > > > + > > > /* Copy the contents of Y to X, but keeping X's current precision. > > > */ template inline void @@ -1821,6 > > > +1828,10 @@ wi::copy (T1 &x, const T2 &y) > > > x.set_len (len, y.is_sign_extended); } > > > > > > +# if GCC_VERSION >=3D 4007 > > > +#pragma GCC diagnostic pop > > > +#endif > > > + > > > /* Return true if X fits in a HOST_WIDE_INT with no loss of > > > precision. */ template inline bool > > > -- > > > 2.25.1 > > >