From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A6C9438376C5; Sat, 21 May 2022 11:17:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A6C9438376C5 From: "sagebar at web dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/105685] New: Still Bogus `-Wsuggest-attribute=cold` on function already marked as `__attribute__((cold))` Date: Sat, 21 May 2022 11:17:32 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 12.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sagebar at web dot de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2022 11:17:32 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105685 Bug ID: 105685 Summary: Still Bogus `-Wsuggest-attribute=3Dcold` on function already marked as `__attribute__((cold))` Product: gcc Version: 12.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: sagebar at web dot de CC: marxin at gcc dot gnu.org Target Milestone: --- I would re-open https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D93087, but I= don't think I can so a new bug report it is... - Anyways: while my test-case from back then remains fixed, the same problem still happens for the following c= ode: Run (`gcc -c -O2 -Wsuggest-attribute=3Dcold infile.c`) ``` extern void external_fun(char *, char const *, int); __attribute__((cold)) char *my_cold_fun(int x) { static char b[42]; external_fun(b, "Without me, the warning disappears?", x); return b; } __attribute__((cold)) char *my_other_cold_fun(int x) { return my_cold_fun(x); } ``` =3D=3D=3D=3D=3D=3D=3D=3D Output =3D=3D=3D=3D=3D=3D=3D=3D >infile.c: In function 'my_other_cold_fun': >infile.c:9:29: warning: function might be candidate for attribute 'cold' [= -Wsuggest-attribute=3Dcold] > 9 | __attribute__((cold)) char *my_other_cold_fun(int x) { > | ^~~~~~~~~~~~~~~~~ =3D=3D=3D=3D=3D=3D=3D=3D Output (Expected) =3D=3D=3D=3D=3D=3D=3D=3D >=