This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR tree-optimization/51513
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Peter Bergner <bergner at vnet dot ibm dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 2 May 2016 10:49:11 +0200
- Subject: Re: [PATCH] Fix PR tree-optimization/51513
- Authentication-results: sourceware.org; auth=none
- References: <1461886509 dot 4256 dot 14 dot camel at vnet dot ibm dot com> <CAFiYyc2yWMnwC5dkOEX+0v5ZkVCatE9RreQtPebcQydxohBR9w at mail dot gmail dot com> <1461931764 dot 4256 dot 25 dot camel at vnet dot ibm dot 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
>
>