[Tfug] GCC optimizations

Bexley Hall bexley401 at yahoo.com
Wed Oct 18 08:01:00 MST 2006


Hi,

Does anyone know if GCC -- and other "non-toy"
compilers -- is smart enough to convert a small
"switch" statement into an equivalent "if-comb"?
And, if so, what criteria it uses to decide when
to do so?

I.e. I'd prefer to leave the optimization to the
compiler, but suspect it may not be smart enough
to do this on its own (and *definitely* not smart
enough to come up with the optimal statement
ordering).

I guess I can rummage through the sources :< and
see what sorts of optimizations it might apply
(though that doesn't tell me how other compilers
would perform).  :(

Thanks!
--don

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




More information about the tfug mailing list