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
* [Bug ipa/105685] [10/11/12 Regression] Bogus `-Wsuggest-attribute=cold` on function already marked as `__attribute__((cold))`
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 ` pinskia at gcc dot gnu.org
2022-05-23 7:04 ` rguenth at gcc dot gnu.org
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-05-21 21:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105685
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic, needs-bisection
Summary|Still Bogus |[10/11/12 Regression] Bogus
|`-Wsuggest-attribute=cold` |`-Wsuggest-attribute=cold`
|on function already marked |on function already marked
|as `__attribute__((cold))` |as `__attribute__((cold))`
Last reconfirmed| |2022-05-21
Known to fail| |10.1.0, 10.3.0, 11.3.0,
| |8.3.0, 9.2.0
Known to work| |8.4.0, 8.5.0, 9.3.0, 9.4.0
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
Target Milestone|--- |10.4
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed. This one is interesting because it was fixed on the 8 and 9 release
branches but is broken in GCC 10.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug ipa/105685] [10/11/12 Regression] Bogus `-Wsuggest-attribute=cold` on function already marked as `__attribute__((cold))`
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
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-23 7:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105685
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug ipa/105685] [10/11/12 Regression] Bogus `-Wsuggest-attribute=cold` on function already marked as `__attribute__((cold))`
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
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-06-28 10:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105685
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|10.4 |10.5
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 10.4 is being released, retargeting bugs to GCC 10.5.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug ipa/105685] [10/11/12 Regression] Bogus `-Wsuggest-attribute=cold` on function already marked as `__attribute__((cold))`
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
` (2 preceding siblings ...)
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
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-07-15 10:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105685
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
Keywords|needs-bisection |
--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
So on e.g. gcc-9 branch it was fixed with r9-8158-g7bf1518f84d5e6 which is a
master backport.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug ipa/105685] [10/11/12/13 Regression] Bogus `-Wsuggest-attribute=cold` on function already marked as `__attribute__((cold))`
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
` (3 preceding siblings ...)
2022-07-15 10:36 ` marxin at gcc dot gnu.org
@ 2023-03-24 16:10 ` jakub at gcc dot gnu.org
2023-03-26 18:15 ` cvs-commit at gcc dot gnu.org
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-03-24 16:10 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105685
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org
Status|NEW |ASSIGNED
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 54744
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54744&action=edit
gcc13-pr105865.patch
Untested fix.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug ipa/105685] [10/11/12/13 Regression] Bogus `-Wsuggest-attribute=cold` on function already marked as `__attribute__((cold))`
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
` (4 preceding siblings ...)
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
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-03-26 18:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105685
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:7eca91d4781bb3df941f25c30b971dac66ba1b3d
commit r13-6865-g7eca91d4781bb3df941f25c30b971dac66ba1b3d
Author: Jakub Jelinek <jakub@redhat.com>
Date: Sun Mar 26 20:15:05 2023 +0200
predict: Don't emit -Wsuggest-attribute=cold warning for functions which
already have that attribute [PR105685]
In the following testcase, we predict baz to have cold
entry regardless of the user supplied attribute (as it call
unconditionally a cold function), but still issue
a -Wsuggest-attribute=cold warning despite it having that attribute
already.
The following patch avoids that.
2023-03-26 Jakub Jelinek <jakub@redhat.com>
PR ipa/105685
* predict.cc (compute_function_frequency): Don't call
warn_function_cold if function already has cold attribute.
* c-c++-common/cold-2.c: New test.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug ipa/105685] [10/11/12 Regression] Bogus `-Wsuggest-attribute=cold` on function already marked as `__attribute__((cold))`
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
` (5 preceding siblings ...)
2023-03-26 18:15 ` cvs-commit at gcc dot gnu.org
@ 2023-03-26 18:43 ` jakub at gcc dot gnu.org
2023-04-18 7:15 ` cvs-commit at gcc dot gnu.org
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-03-26 18:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105685
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[10/11/12/13 Regression] |[10/11/12 Regression] Bogus
|Bogus |`-Wsuggest-attribute=cold`
|`-Wsuggest-attribute=cold` |on function already marked
|on function already marked |as `__attribute__((cold))`
|as `__attribute__((cold))` |
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed on the trunk so far.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug ipa/105685] [10/11/12 Regression] Bogus `-Wsuggest-attribute=cold` on function already marked as `__attribute__((cold))`
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
` (6 preceding siblings ...)
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
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-04-18 7:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105685
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:2407495178fa20382944cdbb875e940ad109f9fb
commit r12-9422-g2407495178fa20382944cdbb875e940ad109f9fb
Author: Jakub Jelinek <jakub@redhat.com>
Date: Sun Mar 26 20:15:05 2023 +0200
predict: Don't emit -Wsuggest-attribute=cold warning for functions which
already have that attribute [PR105685]
In the following testcase, we predict baz to have cold
entry regardless of the user supplied attribute (as it call
unconditionally a cold function), but still issue
a -Wsuggest-attribute=cold warning despite it having that attribute
already.
The following patch avoids that.
2023-03-26 Jakub Jelinek <jakub@redhat.com>
PR ipa/105685
* predict.cc (compute_function_frequency): Don't call
warn_function_cold if function already has cold attribute.
* c-c++-common/cold-2.c: New test.
(cherry picked from commit 7eca91d4781bb3df941f25c30b971dac66ba1b3d)
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug ipa/105685] [10/11 Regression] Bogus `-Wsuggest-attribute=cold` on function already marked as `__attribute__((cold))`
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
` (7 preceding siblings ...)
2023-04-18 7:15 ` cvs-commit at gcc dot gnu.org
@ 2023-04-18 7:20 ` jakub at gcc dot gnu.org
2023-05-02 20:16 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-04-18 7:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105685
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[10/11/12 Regression] Bogus |[10/11 Regression] Bogus
|`-Wsuggest-attribute=cold` |`-Wsuggest-attribute=cold`
|on function already marked |on function already marked
|as `__attribute__((cold))` |as `__attribute__((cold))`
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed also for 12.3.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug ipa/105685] [10/11 Regression] Bogus `-Wsuggest-attribute=cold` on function already marked as `__attribute__((cold))`
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
` (8 preceding siblings ...)
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
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-05-02 20:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105685
--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:c448f0d85c778eade1d8ae597744f6455285346f
commit r11-10730-gc448f0d85c778eade1d8ae597744f6455285346f
Author: Jakub Jelinek <jakub@redhat.com>
Date: Sun Mar 26 20:15:05 2023 +0200
predict: Don't emit -Wsuggest-attribute=cold warning for functions which
already have that attribute [PR105685]
In the following testcase, we predict baz to have cold
entry regardless of the user supplied attribute (as it call
unconditionally a cold function), but still issue
a -Wsuggest-attribute=cold warning despite it having that attribute
already.
The following patch avoids that.
2023-03-26 Jakub Jelinek <jakub@redhat.com>
PR ipa/105685
* predict.c (compute_function_frequency): Don't call
warn_function_cold if function already has cold attribute.
* c-c++-common/cold-2.c: New test.
(cherry picked from commit 7eca91d4781bb3df941f25c30b971dac66ba1b3d)
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug ipa/105685] [10 Regression] Bogus `-Wsuggest-attribute=cold` on function already marked as `__attribute__((cold))`
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
` (9 preceding siblings ...)
2023-05-02 20:16 ` cvs-commit at gcc dot gnu.org
@ 2023-05-03 9:26 ` 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
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-05-03 9:26 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105685
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[10/11 Regression] Bogus |[10 Regression] Bogus
|`-Wsuggest-attribute=cold` |`-Wsuggest-attribute=cold`
|on function already marked |on function already marked
|as `__attribute__((cold))` |as `__attribute__((cold))`
--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for 11.4 as well.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug ipa/105685] [10 Regression] Bogus `-Wsuggest-attribute=cold` on function already marked as `__attribute__((cold))`
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
` (10 preceding siblings ...)
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
12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-05-03 15:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105685
--- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:9fa953c8dfc7ee57ffd33e0b4e8be782c3119666
commit r10-11382-g9fa953c8dfc7ee57ffd33e0b4e8be782c3119666
Author: Jakub Jelinek <jakub@redhat.com>
Date: Sun Mar 26 20:15:05 2023 +0200
predict: Don't emit -Wsuggest-attribute=cold warning for functions which
already have that attribute [PR105685]
In the following testcase, we predict baz to have cold
entry regardless of the user supplied attribute (as it call
unconditionally a cold function), but still issue
a -Wsuggest-attribute=cold warning despite it having that attribute
already.
The following patch avoids that.
2023-03-26 Jakub Jelinek <jakub@redhat.com>
PR ipa/105685
* predict.c (compute_function_frequency): Don't call
warn_function_cold if function already has cold attribute.
* c-c++-common/cold-2.c: New test.
(cherry picked from commit 7eca91d4781bb3df941f25c30b971dac66ba1b3d)
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug ipa/105685] [10 Regression] Bogus `-Wsuggest-attribute=cold` on function already marked as `__attribute__((cold))`
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
` (11 preceding siblings ...)
2023-05-03 15:22 ` cvs-commit at gcc dot gnu.org
@ 2023-05-04 7:17 ` jakub at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-05-04 7:17 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105685
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for 10.5 too.
^ 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).