Re: bit tweaks [was: Re: [nfsd4] potentially hardware breaking regression in 4.14-rc and 4.13.11]

From: Linus Torvalds
Date: Tue Nov 14 2017 - 17:43:26 EST


On Tue, Nov 14, 2017 at 2:24 PM, Rasmus Villemoes
<linux@xxxxxxxxxxxxxxxxxx> wrote:
>
> Can you be more specific? That's not what I see with gcc 7.1.

I have gcc-7.2.1, and it made a horrible mess of the do_mount() code.

Look for the comment "/* Separate the per-mountpoint flags */" and do
the obvious conversion of the simple single-bit stuff.

My gcc actually turned those into jumps after _after_ I converted it
into the ternary operation, and then the ternary conversion actually
did much worse, because it actually had two sides (one with a zero
value, and one with the bit value to be set).

I didn't have time to look into _why_ that code generated
branch-overs, when the otherwise similar reverse case in fs/statfs.c
did not.

Linus