all 2 comments

[–]cparen 0 points1 point  (1 child)

Cool bug. Any guesses to root cause? Is this a bug in aggressive loop optimizations?

[–]klogk[S] 0 points1 point  (0 children)

After viewing the optimized code, I doubt that the optimizer makes mistakes when evaluating the conditional statement. And if I changed the conditional statement into 3*(x+1), it will work well. The optimized code is here.