https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116016
--- Comment #9 from qinzhao at gcc dot gnu.org --- (In reply to Jakub Jelinek from comment #8) > It doesn't matter how it is documented, what matters is how it is > implemented. > E.g. can you do (__builtin_call_with_static_chain) (fn, ptr)? > Or __typeof (__builtin_call_with_static_chain)? > Regular builtins are what is defined in builtins.def. Okay, I guess what did you mean is the following: there are two categories of all the builtin functions provided by GCC to the user as documented in gcc documentation: https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#index-_005f_005fbuiltin_005fcall_005fwith_005fstatic_005fchain Category A: a C/C++ language extension (RID_BUILTIN), which is implemented in the language FE by the parser. For example, __buitlin_call_with_static_chain, __builtin_has_attribute, both belong to this category; Category B: a regular builtin that is defined in builtins.def, which is implemented in the middle-end. For example, __builtin_object_size, __builtin_strcmp_eq, belong to this category; >From my understanding, the new __builtin_set_counted_by could be either implemented in C FE as an C language extension, or in Middle-end as a regular builtin. just depend on what's the user interface we are planing to provide to the user.