public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Peter Bergner <bergner@vnet.ibm.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Fix PR tree-optimization/51513
Date: Mon, 02 May 2016 08:49:00 -0000	[thread overview]
Message-ID: <CAFiYyc21q1-9+CafyHvLom-5qTmrDGSzYuRcEHpbZsUomMV+sg@mail.gmail.com> (raw)
In-Reply-To: <1461931764.4256.25.camel@vnet.ibm.com>

On Fri, Apr 29, 2016 at 2:09 PM, Peter Bergner <bergner@vnet.ibm.com> wrote:
> On Fri, 2016-04-29 at 11:56 +0200, Richard Biener wrote:
>> Your testcase passes '2' where it passes just fine.  If I pass 3 as which
>> I indeed get an abort () but you can't reasonably expect it to return 13 then.
>
> Bah, I added an extra case and didn't change the argument.  :-(
> Let me fix that and then dig into the current behavior.
>
>
>
>> So I fail to see the actual bug you are fixing and I wonder why you do stuff
>> at the GIMPLE level when we only remove the unreachable blocks at RTL
>> level CFG cleanup.  Iff then the "fix" should be there.
>
> I actually started out trying to fix the problem in rtl first, but
> ran into multiple problems, which at the time made it seem like
> fixing this at the GIMPLE level was a better solution.
>
>
>
>> But as said, the behavior is expected - in fact the jump-table code should
>> be optimized for a unreachable default case to simply omit the range
>> check!  That would be a better fix (also avoiding the wild branch).
>
> I know I've seen the wild branch due to normal case statements having
> __builtin_unreachable() too, so it's not just a default case problem.
> That said, I'll have a look to see whether we can fix unreachable
> normal case statements too.  Thanks.

Again, the wild jump is not a bug but at most a missed optimization
(to remove it).

Richard.

> Peter
>
>

  reply	other threads:[~2016-05-02  8:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-28 23:35 Peter Bergner
2016-04-29  9:56 ` Richard Biener
2016-04-29 12:09   ` Peter Bergner
2016-05-02  8:49     ` Richard Biener [this message]
2016-05-02 12:26       ` Peter Bergner

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=CAFiYyc21q1-9+CafyHvLom-5qTmrDGSzYuRcEHpbZsUomMV+sg@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=bergner@vnet.ibm.com \
    --cc=gcc-patches@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).