public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ipa/105685] New: Still Bogus `-Wsuggest-attribute=cold` on function already marked as `__attribute__((cold))`
@ 2022-05-21 11:17 sagebar at web dot de
  2022-05-21 21:41 ` [Bug ipa/105685] [10/11/12 Regression] " pinskia at gcc dot gnu.org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: sagebar at web dot de @ 2022-05-21 11:17 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105685

            Bug ID: 105685
           Summary: Still Bogus `-Wsuggest-attribute=cold` 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=93087, 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 code:

Run (`gcc -c -O2 -Wsuggest-attribute=cold 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);
}
```

======== Output ========
>infile.c: In function 'my_other_cold_fun':
>infile.c:9:29: warning: function might be candidate for attribute 'cold' [-Wsuggest-attribute=cold]
>    9 | __attribute__((cold)) char *my_other_cold_fun(int x) {
>      |                             ^~~~~~~~~~~~~~~~~


======== Output (Expected) ========
><no warning because 'my_other_cold_fun' already is cold>

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-05-04  7:17 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-21 11:17 [Bug ipa/105685] New: Still Bogus `-Wsuggest-attribute=cold` on function already marked as `__attribute__((cold))` sagebar at web dot de
2022-05-21 21:41 ` [Bug ipa/105685] [10/11/12 Regression] " pinskia at gcc dot gnu.org
2022-05-23  7:04 ` rguenth at gcc dot gnu.org
2022-06-28 10:49 ` jakub at gcc dot gnu.org
2022-07-15 10:36 ` marxin at gcc dot gnu.org
2023-03-24 16:10 ` [Bug ipa/105685] [10/11/12/13 " jakub at gcc dot gnu.org
2023-03-26 18:15 ` cvs-commit at gcc dot gnu.org
2023-03-26 18:43 ` [Bug ipa/105685] [10/11/12 " jakub at gcc dot gnu.org
2023-04-18  7:15 ` cvs-commit at gcc dot gnu.org
2023-04-18  7:20 ` [Bug ipa/105685] [10/11 " jakub at gcc dot gnu.org
2023-05-02 20:16 ` cvs-commit at gcc dot gnu.org
2023-05-03  9:26 ` [Bug ipa/105685] [10 " jakub at gcc dot gnu.org
2023-05-03 15:22 ` cvs-commit at gcc dot gnu.org
2023-05-04  7:17 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).