So clearly, dmd does _not_ optimize out the loop. I have no idea whatgdc and ldc do though.
Wow, DMD doesn't optimize it away indeed, just confirmed that by a look at the assembly.
LDC does delete the loop though, starting at -O1, and I can't imagine that GDC wouldn't as well.
David
