netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: netdev@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH][CFT][experimental] net/socket.c: use straight fdget/fdput (resend)
Date: Mon, 27 May 2024 22:25:25 +0100	[thread overview]
Message-ID: <20240527212525.GF2118490@ZenIV> (raw)
In-Reply-To: <20240527163116.GD2118490@ZenIV>

On Mon, May 27, 2024 at 05:31:16PM +0100, Al Viro wrote:

> Hell knows; let me play with that a bit and let's see what falls out...

gcc optimizer is... interesting:

if (v & 1)
        if (!(v & 3))
                foo();

is *NOT* collapsed into a no-op.  Not even

if (v & 1)
        if (!(v & 1) && !(v & 2))
                foo();

is good enough for it.

if (v & 1)
        if (!(v & 1))
                if (!(v & 2))
                        foo();

is recognized, thankfully, but... WTF?  As far as I can tell,
        if (!(v & 1) && !(v & 2))
gets turned into if (!(v & 3)), and then gcc gets stuck on that.
        if (!(v & 1)) if (!(v & 2))
is turned into the same, but apparently only after it actually
looks at both parts in context of what it knows about the earlier
checks.

clang handles all forms just fine, but gcc does not ;-/

      parent reply	other threads:[~2024-05-27 21:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-26  3:45 [PATCH][CFT][experimental] net/socket.c: use straight fdget/fdput (resend) Al Viro
2024-05-26  5:07 ` Linus Torvalds
2024-05-26  5:31   ` Linus Torvalds
2024-05-26 19:27   ` Al Viro
2024-05-26 22:16     ` Linus Torvalds
2024-05-26 23:16       ` Al Viro
2024-05-27 15:23         ` Linus Torvalds
2024-05-27 16:31         ` Al Viro
2024-05-27 19:20           ` Linus Torvalds
2024-05-27 19:35             ` Linus Torvalds
2024-05-27 21:25           ` Al Viro [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240527212525.GF2118490@ZenIV \
    --to=viro@zeniv.linux.org.uk \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).