[Issue 19946] In betterC filling an array with a non-zero value fails for types of size > 1 due to missing _memset16/_memset32/etc.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jun 3 06:57:08 UTC 2022


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

--- Comment #5 from RazvanN <razvan.nitu1305 at gmail.com> ---
(In reply to mhh from comment #4)
> The fix is easy. I wrote the code but never got around to pushing it.
> 
> It just needs to be a template in druntime. Hypothetically you could make it
> inline a loop but this might hurt LDC and GDC.

Besides making it a template, you also need to move the call insertion from
e2ir to the frontend so that semantic analysis is performed on the
instantiation.

> 
> arrayOp actually supports memset but making the array lowering use arrayOp
> would make it end up using itself.
> 
> I also looked into using an arbitrary set memset in the backend but yuck.

I think that long-term the best solution would be to lower the code in the
frontend and, indeed, lower the hooks to templates.

--


More information about the Digitalmars-d-bugs mailing list