New attribute "infrequent"?

Joe Buck jbuck@synopsys.COM
Mon Aug 27 15:11:00 GMT 2001


Linus writes:

> Almost always, the programmer knows which parts of his programs are
> really performance-critical.  Having him/her mark _those_ parts (as
> opposed to the bulk of his program) makes much more sense than trying to
> say "this should be optimized for size" all over the place. 

I agree that a "frequent" directive is better than an "infrequent"
directive, because there is a lot less code in the former category.

But in my experience, except for applications like DSP where control flow is
extremely predictable, most programmers (as opposed to gurus, and even
gurus are imperfect) tend NOT to know, or to guess wrong, about the
performance-critical parts of their program, unless they've profiled it.
Originally Fortran had a FREQUENCY statement.  While I can't find definite
confirmation, the widely reported story is that IBM implemented it
backwards in their Fortran II compiler, and no one noticed for quite some
time.  So it got dropped.



More information about the Gcc mailing list