[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 11 Nov 2012 17:18:55 -0500
From: Xi Wang <xi.wang@...il.com>
To: David Miller <davem@...emloft.net>
CC: netdev@...r.kernel.org
Subject: Re: [PATCH] ipv4: avoid undefined behavior in do_ip_setsockopt()
On 11/11/12 5:02 PM, David Miller wrote:
>
> This code is a fast bit test on purpose. You're making the
> code slower.
No, it's the opposite. All modern compilers optimize switch cases
into a fast bit test. The original "smarter" code, however, hinders
the compiler determining the mask for a fast bit test. With this
patch, GCC is able to compute a better mask. You can check the
assembly.
- xi
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists