public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jemarch at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/114523] bpf: unverifable code due to subreg usage
Date: Thu, 28 Mar 2024 21:06:36 +0000	[thread overview]
Message-ID: <bug-114523-4-CDsfEp8Las@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-114523-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114523

--- Comment #13 from Jose E. Marchesi <jemarch at gcc dot gnu.org> ---
Thanks.  The new title is way better.  And thank you for the further analysis
and the reproducer that also makes clang to generate the no-verifiable code!

I wonder, is the issue also there when -mno-alu32 is used?  In that case the
generated code doesn't involve "subregs" (or 32-bit operations in assembly-like
syntax):

        .file   "foo.c"
        .text
        .align  3
        .global foo
        .type   foo, @function
foo:
        call    bar
        lddw    %r1,baz
        mov     %r0,%r0
        and     %r0,0xffffffff
        ldxw    %r2,[%r1+0]
        add     %r0,-1
        neg     %r2
        xor     %r0,%r2
        rsh     %r0,63
        exit
        .size   foo, .-foo
        .global baz
        .type   baz, @object
        .lcomm  baz,4,4
        .ident  "GCC: (GNU) 14.0.1 20240226 (experimental)"

Cuper, is the verifier able to track proper values through the xor in this
case?

      parent reply	other threads:[~2024-03-28 21:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-28 17:45 [Bug target/114523] New: bpf: ssa-phiopt optimization generates unverifiable code cupertino.miranda at oracle dot com
2024-03-28 17:50 ` [Bug target/114523] " pinskia at gcc dot gnu.org
2024-03-28 17:52 ` pinskia at gcc dot gnu.org
2024-03-28 17:58 ` pinskia at gcc dot gnu.org
2024-03-28 18:05 ` pinskia at gcc dot gnu.org
2024-03-28 18:09 ` pinskia at gcc dot gnu.org
2024-03-28 18:13 ` pinskia at gcc dot gnu.org
2024-03-28 18:20 ` pinskia at gcc dot gnu.org
2024-03-28 18:26 ` pinskia at gcc dot gnu.org
2024-03-28 19:17 ` jemarch at gcc dot gnu.org
2024-03-28 19:29 ` pinskia at gcc dot gnu.org
2024-03-28 19:31 ` pinskia at gcc dot gnu.org
2024-03-28 21:01 ` [Bug target/114523] bpf: unverifable code due to subreg usage pinskia at gcc dot gnu.org
2024-03-28 21:06 ` jemarch at gcc dot gnu.org [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=bug-114523-4-CDsfEp8Las@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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 read-only IMAP folder(s) and NNTP newsgroup(s).