[Bug c/93087] New: Bogus `-Wsuggest-attribute=cold` on function already marked as `__attribute__((cold))`
sagebar at web dot de
gcc-bugzilla@gcc.gnu.org
Sat Dec 28 11:14:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93087
Bug ID: 93087
Summary: Bogus `-Wsuggest-attribute=cold` on function already
marked as `__attribute__((cold))`
Product: gcc
Version: 9.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: sagebar at web dot de
Target Milestone: ---
Created attachment 47555
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47555&action=edit
Issue demonstration
Like the title implies, `-Wsuggest-attribute=cold` is emit for functions that
were already given the `__attribute__((cold))` annotation
The attached file demonstrates the issue, and should be compiled as:
```
gcc -c -O* attached-file.c
```
Where `*` can be any one of `` (empty), `1-3` (though not `0`), `g`, `s`,
`fast`
Note that the issue doesn't arise when no `-O*` flag is given at all (or when
`-O0` is given)
More information about the Gcc-bugs
mailing list