On 1/16/2012 12:22 PM, Manu wrote:
Yes, my first thought when I saw this test was "why is it generating any code at all?".. But I tried to forget about that :) I am curious though, what is causing that code (on both sides) to not be eliminated? If I write that in C, I'm sure it would generate nothing. Is this a language implementation bug somehow?
Compile with inlining off, and the compiler 'forgets' what the called function does, so it must call it.