Re: [PATCH 1/2] compiler_attributes.h: define __no_profile, add to noinstr

From: Fangrui Song
Date: Mon Jun 21 2021 - 14:24:33 EST


On 2021-06-21, Nick Desaulniers wrote:
On Sat, Jun 19, 2021 at 4:32 AM Miguel Ojeda
<miguel.ojeda.sandonis@xxxxxxxxx> wrote:

On Sat, Jun 19, 2021 at 1:26 PM Miguel Ojeda
<miguel.ojeda.sandonis@xxxxxxxxx> wrote:
>
> I am not sure if it is best or not to have the GCC link in order to be
> consistent with the rest of the links (they are for the docs only). Do
> we know if GCC going to implement it soon?

i.e. if GCC does not implement it yet we use elsewhere this kind of
marker instead:

* Optional: not supported by gcc

The first of its kind, normally it is clang/icc there ;-)

:^) GCC does have an attribute since GCC 7.1 for this.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80223#c11
I'm moving Clang over to use that in
https://reviews.llvm.org/D104658
Once that lands, I'll send a v2 (without carrying any reviewed by tags).

Thanks! __attribute__((no_profile_instrument_function)) looks good to me.

Also a reminder that __GCC4_has_attribute___no_profile in v1 misses two
underscores. v2 no_profile_instrument_function may need to fix this.


Reviewed-by: Fangrui Song <maskray@xxxxxxxxxx>


We could nevertheless have the link there, something like:

* Optional: not supported by GCC
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80223

--
Thanks,
~Nick Desaulniers