Infinite recursion with memcpy and memset/memclr lowerings

Johan Engelen j at j.nl
Thu Jul 19 18:49:07 UTC 2018


On Thursday, 19 July 2018 at 12:12:28 UTC, Mike Franklin wrote:
>
> LDC seems to recognize the body of the function and rewrites it 
> as `__aeabi_memclr`, causing infinite recursion.  Is there some 
> way I can instruct the compiler to stop doing that?

You can use `-disable-simplify-libcalls`.

Looks like we need to implement something equivalent to Clang's 
`-fno-builtin` or `-ffreestanding` etc.  After some quick 
research, I don't think it is currently possible to disable these 
optimizations just for one function, can only disable it for one 
compiler invoke.

-Johan



More information about the digitalmars-d-ldc mailing list