On 4/20/17 2:37 AM, Richard Biener wrote: > Ok, so I think we should ensure that we remove the regular cases > with unreachable destination, like in > > switch (i) > { > case 0: > __builtin_unreachable (); > default:; > } > > and handle default with __builtin_unreachable () from switch > expansion by omitting the range check for the jump table > indexing (and choose a non-default case label for gaps).
Ok, I'll modify optimize_unreachable() to remove the unreachable case statements, and leave the unreachable default case statement for switch expansion so we can eliminate the range check. Thanks. Peter