GCC is able to check that the signatures of the builtins are as expected
and this shows some incorrect signatures on ld80 platforms (i.e. x86).
The *tf* functions should take 128-bit arguments but until the latest fixes
they used 80-bit long double.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Do you have an example how this is useful for lib/builtins functions? I think GCC -Wbuiltin-declaration-mismatch is enabled by default and applies to C standard functions (e.g., printf), but I cannot get it to warn on libgcc_s.so.1 functions, e.g.
% cat a.c float __extendhfdf2(float a) { return a; } % gcc -c a.c -Wbuiltin-declaration-mismatch # no warning
Comment Actions
I only see one error right now:
compiler-rt/lib/builtins/divtc3.c:20:26: error: conflicting types for built-in function ‘__divtc3’; expected ‘_Complex _Float128(_Float128, _Float128, _Float128, _Float128)’ [-Werror=builtin-declaration-mismatch] 20 | COMPILER_RT_ABI Lcomplex __divtc3(long double __a, long double __b, | ^~~~~~~~
Comment Actions
I don't see any harm in adding the additional flag, the overall complexity is pretty simple and is more a patterned extension.