public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/102580] Failure to optimize signed division to unsigned division when dividend can't be negative
Date: Thu, 08 Feb 2024 10:31:11 +0000	[thread overview]
Message-ID: <bug-102580-4-ZrOMwkKACo@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-102580-4@http.gcc.gnu.org/bugzilla/>

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aldyh at gcc dot gnu.org,
                   |                            |amacleod at redhat dot com,
                   |                            |jakub at gcc dot gnu.org

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
To be precise, expand_expr_divmod uses get_range_pos_neg for that during
expansion (unless we'd e.g. somehow noted it in some very late pass before
expansion that the division ought to be expanded both ways and cost compared),
and get_range_pos_neg uses the global range of SSA_NAME only.  In order to
optimize #c0 we'd need to query range with the use stmt and enabling ranger in
the pass (that is possible in some pass before expansion, but doing it during
expansion (which would be useful to other spots too, say .*_OVERFLOW expansion)
would need to deal with some basic blocks already converted into RTL and others
still at GIMPLE).

  parent reply	other threads:[~2024-02-08 10:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-03 20:13 [Bug tree-optimization/102580] New: " gabravier at gmail dot com
2021-10-03 20:18 ` [Bug middle-end/102580] " pinskia at gcc dot gnu.org
2021-10-04  7:47 ` rguenth at gcc dot gnu.org
2021-10-17 20:56 ` pinskia at gcc dot gnu.org
2021-10-17 21:02 ` pinskia at gcc dot gnu.org
2021-10-17 21:14 ` pinskia at gcc dot gnu.org
2024-02-08 10:31 ` jakub at gcc dot gnu.org [this message]
2024-02-08 15:59 ` amacleod at redhat dot com
2024-02-08 16:04 ` 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-102580-4-ZrOMwkKACo@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).