[Bug ipa/105685] [10/11 Regression] Bogus `-Wsuggest-attribute=cold` on function already marked as `__attribute__((cold))`
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue May 2 20:16:19 GMT 2023
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)
More information about the Gcc-bugs
mailing list