[PATCH v4] fix warnings in sys/select.h fortification with -Wsign-conversion
Paul Pluzhnikov
ppluzhnikov@google.com
Sat Jun 9 23:07:00 GMT 2012
On Sat, Jun 9, 2012 at 1:24 PM, Paul Eggert <eggert@cs.ucla.edu> wrote:
>> it has slightly more overhead
>
> Not for any modern compiler with normal optimization;
> they all turn (0 <= x && x < CONSTANT) into a single
> unsigned comparison, even if x is signed.
Mike opened BZ#14210 for this, and I commented there:
on Linux/x86_64, the code for __fdelt_chk is identical before/after the patch:
(gdb) disas __fdelt_chk
Dump of assembler code for function __fdelt_chk:
0x00000000000fb910 <+0>: cmp $0x3ff,%rdi
0x00000000000fb917 <+7>: ja 0xfb921 <__fdelt_chk+17>
0x00000000000fb919 <+9>: mov %rdi,%rax
0x00000000000fb91c <+12>: shr $0x6,%rax
0x00000000000fb920 <+16>: retq
0x00000000000fb921 <+17>: push %rax
0x00000000000fb922 <+18>: callq 0xf9a60 <__GI___chk_fail>
End of assembler dump.
Can I have an explicit approval to commit (latest version of) my patch?
Thanks,
--
Paul Pluzhnikov
More information about the Libc-alpha
mailing list