[Issue 22721] importC: some gnu builtins are rejected

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Feb 8 18:34:52 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=22721

--- Comment #5 from dave287091 at gmail.com ---
(In reply to duser from comment #3)
> slight issue with the fix:
> 
> "__builtin_assume_aligned" in the linked GNU docs is different from the
> "__builtin_assume" mentioned in the issue, the actual one is documented here:
> 
> https://releases.llvm.org/13.0.0/tools/clang/docs/LanguageExtensions.
> html#builtin-assume
> 
> its D implementation would be
> 
>   void __builtin_assume()(lazy bool) { return; }
> 
> the assume builtin added in the PR has the signature of
> __builtin_assume_aligned
> from the docs but is named __builtin_assume, it should be renamed to add
> _aligned

__builtin_assume is a clang extension, which I don’t think GCC has. 

https://github.com/llvm/llvm-project/blob/main/clang/include/clang/Basic/Builtins.def#L1550. 

It is present in at least <dispatch/dispatch.h> on macOS.

--


More information about the Digitalmars-d-bugs mailing list