summaryrefslogtreecommitdiff
path: root/gcc/predict.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2020-01-02 10:15:00 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2020-01-02 10:15:00 +0100
commit4ea5d54b3c7175de045589f994fc94ed7e59d80d (patch)
tree4472bba5f8bb5925bc2f7a9345c82197dd3b83f1 /gcc/predict.c
parent2b70275ee1b0de038324280276a9edebcaa93d90 (diff)
re PR ipa/93087 (Bogus `-Wsuggest-attribute=cold` on function already marked as `__attribute__((cold))`)
PR ipa/93087 * predict.c (compute_function_frequency): Don't call warn_function_cold on functions that already have cold attribute. * c-c++-common/cold-1.c: New test. From-SVN: r279829
Diffstat (limited to 'gcc/predict.c')
-rw-r--r--gcc/predict.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/gcc/predict.c b/gcc/predict.c
index 6b60ff4a4d1..a134deb9b3f 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -3937,10 +3937,7 @@ compute_function_frequency (void)
int flags = flags_from_decl_or_type (current_function_decl);
if (lookup_attribute ("cold", DECL_ATTRIBUTES (current_function_decl))
!= NULL)
- {
- node->frequency = NODE_FREQUENCY_UNLIKELY_EXECUTED;
- warn_function_cold (current_function_decl);
- }
+ node->frequency = NODE_FREQUENCY_UNLIKELY_EXECUTED;
else if (lookup_attribute ("hot", DECL_ATTRIBUTES (current_function_decl))
!= NULL)
node->frequency = NODE_FREQUENCY_HOT;