limepoutine
limepoutine
Instead of a copy. Unsure if this is an optimization or a fix.
There is an incomplete jump minimization pass in the backend, that is never used (since the first SVN revision of D2). This PR modernizes and enables the pass. The algorithm...
This PR brings backend RVO facilities in line with the semantics in `canElideCopy()`. The behavior already has tests, I just consolidated two annoying tests (by myself) involving structs with internal...
Fixes #18043. Is slightly messy because it generates fake NRVO variables whenever an NRVO function is being returned.
D's ternary operator (`? :`) can have reference semantics despite being rvalues. For example, `(a() ? a() : b()).mutate()` mutates `a()` if `a()` returns by reference and happens to be...
Follow-up of [Issue 15869](https://issues.dlang.org/show_bug.cgi?id=15869). The fix is a band-aid and initialization is still extremely fragile depending on which optimization kicks in. ```d struct S { bool value; int a, b,...
Follow-up of #22113. The [spec](https://dlang.org/spec/function.html#null-dereferences) explicitly disallows optimizing away null pointer dereference. However, all DMD versions on run.dlang.io [optimize away](https://run.dlang.io/?compiler=dreg&source=import%20std.stdio;%0A%0Aint*%20iptr;%0A%0Aint*%20g()%20@safe%0A%7B%0A%20%20%20%20return%20null;%0A%7D%0A%0Avoid%20main()%20@safe%0A%7B%0A%20%20%20%20iptr%20%3D%20%26(*g());%0A%20%20%20%20writeln(%22Success%22);%0A%7D%0A) `&(*null)`. #22113 is implemented to not change previous behavior, but...
``` struct S { int i; ~this() { i++; } } __gshared immutable S s; ref immutable(S) get() __rvalue { return s; } void consume(S s) {} void main() {...
Only when the struct has a move constructor will the program have expected behavior (no double free) on Windows. The two examples in DIP draft do not work. ```d struct...
```d struct Int { int j; } auto apply(alias f)(Int i) => f(i.j); struct B(alias f1, alias f2) { int k; void allocs() @nogc { // Allocates from GC heap...