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 tree-optimization/94779] Bad optimization of simple switch
Date: Fri, 18 Dec 2020 12:18:42 +0000	[thread overview]
Message-ID: <bug-94779-4-ucEACNzuzy@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-94779-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #20 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Martin Liška from comment #19)
> > 
> > One of the work items for the next release is to multi-range enable all
> > these consumers that can make use of the information.
> 
> I would really appreciate that. I'm don't like integrating VRP into the
> CSWITCH pass mainly because it's duplicate work and EVRP runs right before
> that pass. And I would prefer a more canonical form of switch statements:

See my comment above.  It isn't any integration of VRP, just asking the ranger
about the range, and it isn't useless because to be able to optimize properly,
you need to figure out for each value one of the 3 possibilities (handled
explicitly by switch and well defined, handled by default and never reachable
or UB).  It is expected that many further passes will just query the ranger
when they need some information in the future; currently they sometimes just
get_range_info to query the static single range and often not even that.
VRP and other passes can perhaps throw out labels which won't be reachable
because they are outside of the index range (they shouldn't throw out labels
that lead to __builtin_unreachable because then information would be lost for
the optimization), but still the optimization needs to categorize the values.

  parent reply	other threads:[~2020-12-18 12:18 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-27  0:40 [Bug tree-optimization/94779] New: " gabravier at gmail dot com
2020-04-27  4:31 ` [Bug tree-optimization/94779] " marxin at gcc dot gnu.org
2020-04-27  4:35 ` gabravier at gmail dot com
2020-04-27  4:38 ` gabravier at gmail dot com
2020-04-27  4:46 ` marxin at gcc dot gnu.org
2020-04-27  5:47 ` gabravier at gmail dot com
2020-04-27  6:15 ` gabravier at gmail dot com
2020-04-27  6:47 ` rguenth at gcc dot gnu.org
2020-04-27  6:51 ` gabravier at gmail dot com
2020-05-06 15:08 ` jakub at gcc dot gnu.org
2020-05-06 15:12 ` marxin at gcc dot gnu.org
2020-05-06 15:24 ` jakub at gcc dot gnu.org
2020-12-15 13:35 ` jakub at gcc dot gnu.org
2020-12-15 15:02 ` amacleod at redhat dot com
2020-12-17 13:36 ` marxin at gcc dot gnu.org
2020-12-17 13:41 ` jakub at gcc dot gnu.org
2020-12-17 13:57 ` marxin at gcc dot gnu.org
2020-12-17 14:07 ` jakub at gcc dot gnu.org
2020-12-17 16:38 ` amacleod at redhat dot com
2020-12-18 12:07 ` marxin at gcc dot gnu.org
2020-12-18 12:18 ` jakub at gcc dot gnu.org [this message]
2020-12-18 12:30 ` marxin at gcc dot gnu.org
2020-12-18 14:35 ` amacleod at redhat dot com
2021-08-16 12:39 ` marxin 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-94779-4-ucEACNzuzy@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).