Need some opinions

Jeffrey A Law law@hurl.cygnus.com
Wed Mar 3 20:36:00 GMT 1999


  In message < 199903030042.VAA10303@sleipnir.valparaiso.cl >you write:
  > Interesting idea. How much do you think does that buy on executable run
  > time?
The folks asking for this usually do so because the compiler is emitting
truely stupid code like branches to the next instruction, or a branch around
an unconditional branch.

Nobody's actually tried to benchmark the code or anything like that.

  > How much compile time cost?
Very small.  Jump optimizations, particularly these are very fast.  In "dumb"
mode we would only iterate once instead of iterating until nothing changes
(similar to what we do for branch shortening).


  > > Another would be to rearrange the meaning of -O1, -O2, -O3, etc to make
  > > space for a -O1 option which did just these simple optimizations.
  > 
  > No way. -O2 et al are widely entrenched by now (for better or worse).
I suspect this is the case.  And it is definitely for the worse IMHO.

  > > A third would be to have it controlled by a flag which could be enabled
  > > even when optimize == 0.
  > 
  > Reasonable too, but yet another flag that interacts with all the others in
  > possibly weird ways?
I don't see that many interactions.

  > Or you could add this to -O1 and up.
-O1 already runs the full jump optimizer, so a dumb jump optimization pass
would not be particularly useful (except to clean up the cfg for sibcall and
tail recursion elimination)

jeff


More information about the Gcc mailing list