#"for" cycle optimization issue

3 messages · Page 1 of 1 (latest)

flint sphinx
#

The programs on the pictures above print numbers from set {4*n | n ∈ [0; 31] ⋂ Z }
Both cycles do the same thing, but rust "for" cycle has more lines in the assembly code and works a bit slower
Why compiler does not optimize this "for" cycle to be as fast as "while" one?
Flags are -C opt-level=3 -C target-cpu=native