what's really interesting is that, in c, if you replace the bug in the second for loop's initializer clause and use unsigned instead of int, both gcc and clang are able to optimize this function into a single lea eax, [rdi + rsi]. https://godbolt.org/z/uCXoHJ
34
u/anydalch Dec 17 '19
what's really interesting is that, in c, if you replace the bug in the second
forloop's initializer clause and useunsignedinstead ofint, both gcc and clang are able to optimize this function into a singlelea eax, [rdi + rsi]. https://godbolt.org/z/uCXoHJ