http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58195
Joel Yliluoma <bisqwit at iki dot fi> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bisqwit at iki dot fi
--- Comment #1 from Joel Yliluoma <bisqwit at iki dot fi> ---
Problem confirmed on "gcc (GCC) 4.9.0 20140303 (experimental)" (SVN version) in
both 32-bit and 64-bit mode using -Ofast.
For comparison, Clang++ produces this instead (even on -O1):
negl %edi
movl %edi, %eax
ret
GCC misses an optimization opportunity here.