Infinite recursion with memcpy and memset/memclr lowerings

Mike Franklin slavo5150 at
Thu Jul 19 12:12:28 UTC 2018

I ran into an interesting situation with my ARM Cortex-M 
experiment using LDC.

I have this function:

extern(C) void* __aeabi_memclr(void* dest, size_t num)
     byte* d = cast(byte*)dest;
     for(int i = 0; i < num; i++)
         d[i] = cast(byte)0;

     return dest;

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?


More information about the digitalmars-d-ldc mailing list