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

--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Peter Bergner from comment #8)
> So we have a switch statement with onc case and a default case statement. 
> The normal case statement contains an __builtin_unreachable() call, so we
> delete the case statement, leaving us with only the default case.  We then
> call into expand_case() and we have this code which has been there for a
> while:
> 
>   /* Get upper and lower bounds of case values.  */
>   elt = gimple_switch_label (stmt, 1);
> 
> Since there is only one default case statement in stmt, asking for the label
> at offset "1" is illegal and that leads to the ICE.  Either we need to
> protect this code or maybe we can remove the switch statement all together.

I think we should be defensive here but also take the opportunity to remove
the switch stmt.

Reply via email to