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.

Peter


Reply via email to