Re: [PATCH] ipv4: avoid undefined behavior in do_ip_setsockopt()
From: Xi Wang <xi.wang@gmail.com> Date: 2012-11-11 22:18:58
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