GNU bug report logs - #66002
[PATCH] build: suppress suggest-attribute=cold warnings

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: grep; Reported by: Gleb Fotengauer-Malinovskiy <glebfm@HIDDEN>; Keywords: patch; dated Fri, 15 Sep 2023 15:28:02 UTC; Maintainer for grep is bug-grep@HIDDEN.

Message received at 66002 <at> debbugs.gnu.org:


Received: (at 66002) by debbugs.gnu.org; 16 Sep 2023 23:05:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 16 19:05:02 2023
Received: from localhost ([127.0.0.1]:48725 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qheLS-0008If-9g
	for submit <at> debbugs.gnu.org; Sat, 16 Sep 2023 19:05:01 -0400
Received: from vmicros1.altlinux.org ([194.107.17.57]:59974)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <glebfm@HIDDEN>) id 1qhcqz-0002xi-Gc
 for 66002 <at> debbugs.gnu.org; Sat, 16 Sep 2023 17:29:26 -0400
Received: from imap.altlinux.org (imap.altlinux.org [194.107.17.38])
 by vmicros1.altlinux.org (Postfix) with ESMTP id 8C4C472C8D3;
 Sun, 17 Sep 2023 00:29:11 +0300 (MSK)
Received: from glebfm.altlinux.org (flight.tilaa.cloud [84.22.108.118])
 by imap.altlinux.org (Postfix) with ESMTPSA id 5FD2A36D00B7;
 Sun, 17 Sep 2023 00:29:11 +0300 (MSK)
Date: Sun, 17 Sep 2023 01:28:53 +0400
From: Gleb Fotengauer-Malinovskiy <glebfm@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
Subject: Re: bug#66002: [PATCH] build: suppress suggest-attribute=cold warnings
Message-ID: <ZQYeFaerbRNau7Lc@HIDDEN>
References: <20230915134500.1718945-1-glebfm@HIDDEN>
 <0d8eed7c-fd35-66c2-986c-62569e7160a9@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <0d8eed7c-fd35-66c2-986c-62569e7160a9@HIDDEN>
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 66002
X-Mailman-Approved-At: Sat, 16 Sep 2023 19:04:57 -0400
Cc: 66002 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Fri, Sep 15, 2023 at 05:04:05PM -0700, Paul Eggert wrote:
> On 9/15/23 08:45, Gleb Fotengauer-Malinovskiy wrote:
> > Following the glibc commit glibc-2.38~298 ("Mark various cold functions
> > as __COLD"), GNU grep build with -flto flag triggers a GCC warning:
> > 
> > sigsegv.c: In function ‘stackoverflow_deinstall_handler.part.0’:
> > sigsegv.c:1441:1: error: function might be candidate for attribute ‘cold’ [-Werror=suggest-attribute=cold]
> > 
> > * configure.ac (GNULIB_WARN_CFLAGS): Suppress -Wsuggest-attribute=cold.
> 
> I'm not seeing this problem on Fedora 38 when I manually mark error, 
> error_at_line, and perror with _GL_ATTRIBUTE_COLD. I am compiling with 
> gcc (GCC) 13.2.1 20230728 (Red Hat 13.2.1-1) and configuring with 
> "./configure --enable-gcc-warnings 'CC=gcc -flto'". This is grep commit 
> 102be2bfa571355ff44db39348438a0def1ab382.
> 
> If you're using an older GCC,

I've encountered this warning with a version of GCC that's very similar:
gcc-13 (GCC) 13.2.1 20230817 (ALT Sisyphus 13.2.1-alt2)

I'm not certain what's different in our testing, but I managed to
reproduce it on Fedora 38.  This occurred both when I made a simple edit
to the /usr/include/stdio.h header:
-extern void perror (const char *__s);
+extern void perror (const char *__s) __attribute__ ((__cold__));
and with glibc version 2.38.9000-8.fc40.x86_64 from Rawhide.

> I wouldn't worry about the false alarm, 
> whatever it's about (it's not clear from the diagnostic). The 
> attribute-cold diagnostics are occasionally helpful for minor 
> performance tuning, and are harmless if ignored.

I'm not insisting that this needs to be addressed, but I do believe that
someone else might encounter this issue.

-- 
glebfm




Information forwarded to bug-grep@HIDDEN:
bug#66002; Package grep. Full text available.

Message received at 66002 <at> debbugs.gnu.org:


Received: (at 66002) by debbugs.gnu.org; 16 Sep 2023 00:04:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 15 20:04:25 2023
Received: from localhost ([127.0.0.1]:45081 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qhInQ-0006nl-Kz
	for submit <at> debbugs.gnu.org; Fri, 15 Sep 2023 20:04:24 -0400
Received: from mail.cs.ucla.edu ([131.179.128.66]:52218)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1qhInL-0006nR-KE
 for 66002 <at> debbugs.gnu.org; Fri, 15 Sep 2023 20:04:23 -0400
Received: from localhost (localhost [127.0.0.1])
 by mail.cs.ucla.edu (Postfix) with ESMTP id 7A8353C00F586;
 Fri, 15 Sep 2023 17:04:06 -0700 (PDT)
Received: from mail.cs.ucla.edu ([127.0.0.1])
 by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id cJyZuQ0c6u0u; Fri, 15 Sep 2023 17:04:05 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.cs.ucla.edu (Postfix) with ESMTP id A26ED3C00D18F;
 Fri, 15 Sep 2023 17:04:05 -0700 (PDT)
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu A26ED3C00D18F
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu;
 s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1694822645;
 bh=W5TsS1o5YTqaZ/i3F3OBEyGZ/5gCpTsztvlaYTVHrgM=;
 h=Message-ID:Date:MIME-Version:To:From;
 b=TlgW9xhu7v2R0UXekRCns1bV6VmoXtNTEhUUrX8oYThgMLbjPM1l7okPB5v01PDyN
 W2sl5kJXjVr7BR9GlTnzSVVFyXhGx1fbEZnNSu8iYxAkOG0iH1K5LpoIDyNziDUSSu
 tjZl9rnBqBs2iO3Zx2d1jvuwH5xb5vbEJR+Ux/XAJWIhjg3B5IjuN8d8zZumRgPKg0
 wcbShRN+qy6nohcwbzVFZLf/DH8lM5qtLlxO+MAdx8eg8uCysfOtRCU2kpidrkRHmt
 cLqpWhO4vq9YNzcb4ayhVLLu+sjc6MV0s7Z5YlR4iLZdfhMSXEfw+4opzKy4xIv/sQ
 LThsAWUJXP+9A==
X-Virus-Scanned: amavisd-new at mail.cs.ucla.edu
Received: from mail.cs.ucla.edu ([127.0.0.1])
 by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id LV6v2wdYJ4Rd; Fri, 15 Sep 2023 17:04:05 -0700 (PDT)
Received: from [131.179.23.235] (wifi-131-179-23-235.host.ucla.edu
 [131.179.23.235])
 by mail.cs.ucla.edu (Postfix) with ESMTPSA id 8AA5C3C00F586;
 Fri, 15 Sep 2023 17:04:05 -0700 (PDT)
Message-ID: <0d8eed7c-fd35-66c2-986c-62569e7160a9@HIDDEN>
Date: Fri, 15 Sep 2023 17:04:05 -0700
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.15.1
Subject: Re: bug#66002: [PATCH] build: suppress suggest-attribute=cold warnings
To: Gleb Fotengauer-Malinovskiy <glebfm@HIDDEN>, 66002 <at> debbugs.gnu.org
References: <20230915134500.1718945-1-glebfm@HIDDEN>
Content-Language: en-US
From: Paul Eggert <eggert@HIDDEN>
In-Reply-To: <20230915134500.1718945-1-glebfm@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -1.5 (-)
X-Debbugs-Envelope-To: 66002
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.5 (--)

On 9/15/23 08:45, Gleb Fotengauer-Malinovskiy wrote:
> Following the glibc commit glibc-2.38~298 ("Mark various cold functions
> as __COLD"), GNU grep build with -flto flag triggers a GCC warning:
>=20
> sigsegv.c: In function =E2=80=98stackoverflow_deinstall_handler.part.0=E2=
=80=99:
> sigsegv.c:1441:1: error: function might be candidate for attribute =E2=80=
=98cold=E2=80=99 [-Werror=3Dsuggest-attribute=3Dcold]
>=20
> * configure.ac (GNULIB_WARN_CFLAGS): Suppress -Wsuggest-attribute=3Dcol=
d.

I'm not seeing this problem on Fedora 38 when I manually mark error,=20
error_at_line, and perror with _GL_ATTRIBUTE_COLD. I am compiling with=20
gcc (GCC) 13.2.1 20230728 (Red Hat 13.2.1-1) and configuring with=20
"./configure --enable-gcc-warnings 'CC=3Dgcc -flto'". This is grep commit=
=20
102be2bfa571355ff44db39348438a0def1ab382.

If you're using an older GCC, I wouldn't worry about the false alarm,=20
whatever it's about (it's not clear from the diagnostic). The=20
attribute-cold diagnostics are occasionally helpful for minor=20
performance tuning, and are harmless if ignored.




Information forwarded to bug-grep@HIDDEN:
bug#66002; Package grep. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 15 Sep 2023 15:27:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 15 11:27:02 2023
Received: from localhost ([127.0.0.1]:44466 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qhAih-0003Wu-4a
	for submit <at> debbugs.gnu.org; Fri, 15 Sep 2023 11:27:02 -0400
Received: from lists.gnu.org ([2001:470:142::17]:49546)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <glebfm@HIDDEN>) id 1qh99z-0000LC-Ka
 for submit <at> debbugs.gnu.org; Fri, 15 Sep 2023 09:47:04 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <glebfm@HIDDEN>)
 id 1qh99d-0003rP-UI
 for bug-grep@HIDDEN; Fri, 15 Sep 2023 09:46:45 -0400
Received: from vmicros1.altlinux.org ([194.107.17.57])
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <glebfm@HIDDEN>) id 1qh99Y-00028O-4x
 for bug-grep@HIDDEN; Fri, 15 Sep 2023 09:46:40 -0400
Received: from imap.altlinux.org (imap.altlinux.org [194.107.17.38])
 by vmicros1.altlinux.org (Postfix) with ESMTP id 9066272C8D3
 for <bug-grep@HIDDEN>; Fri, 15 Sep 2023 16:46:33 +0300 (MSK)
Received: from localhost (localhost.localdomain [127.0.0.1])
 by imap.altlinux.org (Postfix) with ESMTP id 6D70136D00B7;
 Fri, 15 Sep 2023 16:46:33 +0300 (MSK)
From: Gleb Fotengauer-Malinovskiy <glebfm@HIDDEN>
To: bug-grep@HIDDEN
Subject: [PATCH] build: suppress suggest-attribute=cold warnings
Date: Fri, 15 Sep 2023 13:45:00 +0000
Message-Id: <20230915134500.1718945-1-glebfm@HIDDEN>
X-Mailer: git-send-email 2.33.8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=194.107.17.57; envelope-from=glebfm@HIDDEN;
 helo=vmicros1.altlinux.org
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.9 (/)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Fri, 15 Sep 2023 11:26:57 -0400
Cc: Gleb Fotengauer-Malinovskiy <glebfm@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.1 (/)

Following the glibc commit glibc-2.38~298 ("Mark various cold functions
as __COLD"), GNU grep build with -flto flag triggers a GCC warning:

sigsegv.c: In function ‘stackoverflow_deinstall_handler.part.0’:
sigsegv.c:1441:1: error: function might be candidate for attribute ‘cold’ [-Werror=suggest-attribute=cold]

* configure.ac (GNULIB_WARN_CFLAGS): Suppress -Wsuggest-attribute=cold.

Tiny-change: yes
---
 configure.ac | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/configure.ac b/configure.ac
index 844a259bd..b793cabde 100644
--- a/configure.ac
+++ b/configure.ac
@@ -159,6 +159,11 @@ if test $gl_gcc_warnings != no; then
   # Remove the following and save the result in GNULIB_WARN_CFLAGS.
   nw=
   nw="$nw -Wunused-macros"
+
+  # To prevent warnings in sigsegv.c if the perror function
+  # has "cold" attribute.
+  nw="$nw -Wsuggest-attribute=cold"
+
   gl_WARN_ADD([-Wno-format-nonliteral])
   gl_MANYWARN_COMPLEMENT([GNULIB_WARN_CFLAGS], [$WARN_CFLAGS], [$nw])
   AC_SUBST([GNULIB_WARN_CFLAGS])
-- 
glebfm





Acknowledgement sent to Gleb Fotengauer-Malinovskiy <glebfm@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-grep@HIDDEN. Full text available.
Report forwarded to bug-grep@HIDDEN:
bug#66002; Package grep. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 16 Sep 2023 23:15:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.