optimization hints?

Alex Rosenberg alexr@spies.com
Wed Jun 30 15:43:00 GMT 1999


> just the fact that I don't expect an error (poll() returning -1),
> I was hoping to be able to tell it that this code isn't likely to
> execute and perhaps even move it someplace else to maximize the
> instruction cache utilization of my code.

Apple's MrC compiler has two pragmas for this:

#pragma seldom

This moves the marked block to the end of the function (after the exit
node).

#pragma outofline

This puts the marked block in a seperate GL function in the XCOFF, which
results in placement at the end of the file by the linker.

Both would be straight-forward to implement in egcs, but pragmas have been
shunned in the past. No keyword alternative approach comes to mind.

A particularly useful variant would be to automatically move C++ catch
blocks.

+------------------------------------------------------------+
| Alexander M. Rosenberg           < mailto:alexr@_spies.com > |
| Nobody cares what I say. Remove the underscore to mail me. |



More information about the Gcc mailing list