Commit 4ea5d54b by Jakub Jelinek Committed by Jakub Jelinek

re PR ipa/93087 (Bogus `-Wsuggest-attribute=cold` on function already marked as…

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
parent 2b70275e
2020-01-02 Jakub Jelinek <jakub@redhat.com>
PR ipa/93087
* predict.c (compute_function_frequency): Don't call
warn_function_cold on functions that already have cold attribute.
2020-01-01 John David Anglin <danglin@gcc.gnu.org>
PR target/67834
......
......@@ -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;
......
2020-01-02 Jakub Jelinek <jakub@redhat.com>
PR ipa/93087
* c-c++-common/cold-1.c: New test.
2020-01-01 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/90374
......
/* PR ipa/93087 */
/* { dg-do compile { target nonpic } } */
/* { dg-options "-O1 -Wsuggest-attribute=cold" } */
extern void *getdata (void);
extern int set_error (char const *message) __attribute__((cold));
__attribute__((cold)) int
set_nomem (void) /* { dg-bogus "function might be candidate for attribute 'cold'" } */
{
return set_error ("Allocation failed");
}
void *
getdata_or_set_error (void)
{
void *result;
result = getdata ();
if (!result)
set_nomem ();
return result;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment