public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/114032] ifcvt may introduce UB calls to __builtin_clz(0)
Date: Thu, 22 Feb 2024 10:50:35 +0000	[thread overview]
Message-ID: <bug-114032-4-rnJzVdeJ2W@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-114032-4@http.gcc.gnu.org/bugzilla/>

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2024-02-22
     Ever confirmed|0                           |1
                 CC|                            |rguenth at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
With other cases the fear is we'd completely unroll and decompose to scalars
again and then VRP eventually deriving wrong ranges.

So yeah, ifcvt would have to use a .COND_CALL here or some other tricks to
avoid the situation - like a .CLZ with the out-of-range behavior specified
according to what the target does.  OTOH that target behavior might differ
between scalar and vector modes (maybe even different vector modes ...).

Do we actually treat CLZ (0) as invoking undefined behavior?  IIRC we have
match patterns that rely on that but conditional on that target hook?
IL semantics based on hooks is ... bad.

Anyway - did we create a meta-bug to link all these issues together?

  parent reply	other threads:[~2024-02-22 10:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-21 14:03 [Bug tree-optimization/114032] New: " kristerw at gcc dot gnu.org
2024-02-21 14:37 ` [Bug tree-optimization/114032] " jakub at gcc dot gnu.org
2024-02-22 10:50 ` rguenth at gcc dot gnu.org [this message]
2024-02-22 11:03 ` jakub at gcc dot gnu.org

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-114032-4-rnJzVdeJ2W@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).