[RFC] A new data structure for SWITCH_EXPR
Kai Henningsen
kaih@khms.westfalen.de
Mon Nov 8 09:08:00 GMT 2004
zack@codesourcery.com (Zack Weinberg) wrote on 07.11.04 in <87zn1sapm2.fsf@codesourcery.com>:
> First, I'd like to point out that use of the "case A ... B:" feature
> is extremely rare, at least when it's via the GNU extension to C.
> Perhaps other languages use it more frequently. As such, it might
Actually, it's *very* common in other languages, and what you propose
would seem to be a pretty catastrophic regression.
I have always considered it a serious design bug that C does not include
this natively. It makes switch statements *much* less useful.
> make sense to drop CASE_HIGH entirely, having front ends break up A
> ... B into individual CASE_LABEL_NODEs for all the values in the
> range. Ranges would get more expensive, but each individual case
> would get cheaper.
Ranges would get ridiculously expensive.
MfG Kai
More information about the Gcc
mailing list