4 ms·
I just tried this, and GCC6 does indeed optimise this correctly: 0000000000400560 <maybe_overflow>: 400560: 01 f7 add %esi,%edi
by efaref 10y ago
I just tried this, and GCC6 does indeed optimise this correctly:
0000000000400560 <maybe_overflow>:
400560: 01 f7 add %esi,%edi
400562: 70 03 jo 400567 <maybe_overflow+0x7>
400564: 89 f8 mov %edi,%eax
400566: c3 retq
400567: 31 c0 xor %eax,%eax
400569: c3 retq