This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: switch index optimization
- To: law at cygnus dot com
- Subject: Re: switch index optimization
- From: Joe Buck <jbuck at synopsys dot com>
- Date: Tue, 27 Jan 98 10:19:16 PST
- Cc: ak at muc dot de, Lassi dot Tuura at cern dot ch, rth at cygnus dot com, jbuck at synopsys dot com, egcs at cygnus dot com
> > Another example where it could benefit: gotoless exits from nested loops:
> > ...
Jeff writes:
> The stuff we're talking about probably won't help that case. This needs
> global constant/copy propagation into if/else statements. It's on the
> list of things to do.
If you're going to do that, it seems you could go one step further and
propagate ranges (min and max values of expressions). Constant
propagation is then just a special case (min == max). With this framework
one could then implement efficient array bounds checking (omitting checks
for expressions guaranteed to be within range).