On Thursday, 26 December 2013 at 08:08:09 UTC, Lionello Lunesu
wrote:
You should have said that all instructions are redundant :)
Looks like the array got optimized out, but then the optimizer
stopped. The ECX likely refers to the 'i' loop variable. When
the array write code got optimized out, the compile could have
figured out that 'i' was in turn unused as well and remove it
too. And then, the foreach, etc...
I added the "return a[7];" part from bearophile's suggestion, but
that did not change anything in the loop code. So, my guess is
that the array does not get optimized out at all.
You can file backend bugs on the same site.
Thanks, issue created!
https://d.puremagic.com/issues/show_bug.cgi?id=11821
Ivan Kazmenko.