[Bug 293] Utilize assert (ptr == (ptr & -align)) to assume alignment

2018-06-29 Thread gdc-bugzilla--- via D.gnu
https://bugzilla.gdcproject.org/show_bug.cgi?id=293 Iain Buclaw changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

Re: Alloca without core.stdc.stdlib?

2018-06-29 Thread Iain Buclaw via D.gnu
On 29 June 2018 at 11:28, ARaspiK via D.gnu wrote: > On Friday, 29 June 2018 at 09:17:58 UTC, ARaspiK wrote: >> >> According to core.stdc.stdlib, alloca (on GDC) is a compiler intrinsic. >> But I can't separate it from the rest of core.stdc.stdlib, for a small >> druntime I'm making. Here's what i

[Bug 293] Utilize assert (ptr == (ptr & -align)) to assume alignment

2018-06-29 Thread gdc-bugzilla--- via D.gnu
https://bugzilla.gdcproject.org/show_bug.cgi?id=293 --- Comment #2 from ARaspiK --- Welp, I just discovered gcc.builtins. __builtin_assume_aligned did the trick. For anybody wondering: `import gcc.builtins` will pull in all (most?) GCC builtin functions. __builtin_assume_aligned is among them.

Re: Alloca without core.stdc.stdlib?

2018-06-29 Thread ARaspiK via D.gnu
On Friday, 29 June 2018 at 09:17:58 UTC, ARaspiK wrote: According to core.stdc.stdlib, alloca (on GDC) is a compiler intrinsic. But I can't separate it from the rest of core.stdc.stdlib, for a small druntime I'm making. Here's what it seems to be: version(GNU) extern(C) @system nothrow @nogc v

Alloca without core.stdc.stdlib?

2018-06-29 Thread ARaspiK via D.gnu
According to core.stdc.stdlib, alloca (on GDC) is a compiler intrinsic. But I can't separate it from the rest of core.stdc.stdlib, for a small druntime I'm making. Here's what it seems to be: version(GNU) extern(C) @system nothrow @nogc void* alloca(size_t size) pure; Writing the declaration