Well, some 10 years ago I wrote an extra optimization phase that
processed the assembly output of the Alcyon C compiler for the Atari ST.
(I used a lot of switch/case constructs with common code, and got
irritated by the inefficient code generated)
With some simple (fixed-pattern) code sequence substitutions, followed
by analyzing common code, jumps-to-jumps, and jumps-over-unconditional-jumps,
I was able to improve code for examples like that quite a bit. In fact,
there would be no difference between the use of goto and the cleaner
alternative.
The optimizer was very simple. I'm sure similar operations could be done
internal to GCC, but apparently it is not doing it.
Rob
-- +------------------------------------+--------------------------------------+ | Rob Janssen rob@knoware.nl | AMPRnet: rob@pe1chl.ampr.org | | e-mail: pe1chl@wab-tis.rabobank.nl | AX.25 BBS: PE1CHL@PI8WNO.#UTR.NLD.EU | +------------------------------------+--------------------------------------+