Thank you for all answers, which are very useful for us! As you pointed out, we only considered GitHub projects. If I understood correctly, builtins would still not be deprecated even if we considered all other open-source hosting sites because closed-source projects could still rely on them, right? Additionally, target-specific builtins could not be deprecated or removed because of vendor ABIs.
Several of you noted that we did not consider internal builtins that are used in the implementation of GCC headers or directly by the compiler. Also the documentation mentions that GCC provides "a large number of built-in functions other than the ones mentioned" for "internal use" which "are not documented here because they may change from time to time" (see https://gcc.gnu.org/onlinedocs/gcc-7.2.0/gcc/Other-Builtins.html#Other- Builtins). We deliberately looked only at public builtins (and not internal ones), as we are mainly interested in the effort needed to support GCC builtins in other tools that process C code (e.g., other compilers or analysis tools). We want to prevent that such tool developers need to implement internal or unused builtins. So even if we cannot remove the implementation of a builtin, removing it from the documentation could already be a win. In a second step, we also considered internal builtins and found that the vararg handling builtins (__builtin_va_start, __builtin_va_end, __builtin_va_arg, and __builtin_va_copy) are relied upon by many projects, even though they are undocumented in GCC's builtins API. Could they be added to the documentation? Thanks, Manuel 2018-01-22 19:29 GMT+01:00 Florian Weimer <f...@deneb.enyo.de>: > * Manuel Rigger: > > > Details: We downloaded all C projects from GitHub that had more than 80 > > GitHub stars, which yielded almost 5,000 projects with a total of more > > than one billion lines of C code. We filtered GCC, forks of GCC, and > > other compilers as we did not want to incorporate internal usages of GCC > > builtins or test cases. We extracted all builtin names from the GCC > > docs, and also tried to find such names in the source code, which we > > considered as builtin usages. > > You actually need to compile the sources with an instrumented compiler > to discover uses of built-ins. Not all references will have verbatim, > textual references in source code, but their names are constructed > using preprocessor macros. This happens for the majority of the > floating-point-related built-ins you listed, I think. >