You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#include<stdio.h>intfoo(void) {
asm goto ("some asm" : : : : NoError);
/* This branch (the fall-through from the asm) is less commonly used */ErrorHandling:
__attribute__((cold, unused)); /* Semi-colon is required here */printf("error\n");
return0;
NoError:
printf("no error\n");
return1;
}
clang:
warning: 'cold' attribute only applies to functions [-Wignored-attributes]
__attribute__((cold, unused)); /* Semi-colon is required here */
^
The text was updated successfully, but these errors were encountered:
It looks like clang already supports __attribute__((unused)) for -Wunused-label, so this is really just about __attribute__((hot)) and __attribute__((cold)). Re-titling the bug.
That attribute should technically be useless, as the indirect branch from an asm goto block is already marked as "cold", at least in clang.
Things get weird when outputs are involved, but without any I suspect it might be nice to mark which indirect branch is hot or hotter than the fallthrough BB.
Extended Description
https://gcc.gnu.org/onlinedocs/gcc/Label-Attributes.html#Label-Attributes
https://godbolt.org/z/Er3rP8
clang:
The text was updated successfully, but these errors were encountered: