Related articles |
---|
Re: Encripted source as an ANDF (really FORTRAN vs C optimization) diomidis@ecrcvax.UUCP (1989-06-15) |
Newsgroups: | comp.compilers |
Summary: | ANSI C allows some more optimisiations than traditional C |
References: | <4001@ima.ima.isc.com> |
From: | diomidis@ecrcvax.UUCP (Diomidis Spinellis) |
Organization: | ECRC, Munich 81, West Germany |
Keywords: | FORTRAN C optimization trigonometric loop |
In article <4001@ima.ima.isc.com> kbierman@sun.com writes:
>The real fly in the ointment is that C semantics sabatoge many of the
>best optimizations currently available to other languages (like most
>good fortran compilers).
>
>[...]
>2) "for" vs "do"
> (while the author of the proposal may think it best to reduce
> directly to GOTO's, DO loops ensure that the control variable may
> not be modified by anything in its body ... thus allowing many
> interesting optimizations ... w/o having to do extensive analysis)
The use of a ``register'' variable as a loop control variable insures
that no alias is used for that variable. Thus the compiler only has
to look at the code inside the loop body in order to determine if the
variable is modified or not. In most cases it will not be modified
and the interesting optimizations can be performed.
>[...]
>4) trig functions (built into fortran) and many other items of interest in
> the "real "go fast"" community.
ANSI C defines the semantics of many functions including the trig functions.
Thus an ANSI C compiler is free to use inline code or known properties of
these functions. Many compilers that are conformant to ANSI drafts already
produce such code and Matthew Self (self@bayes.arc.nasa.gov) has posted
an almost ANSI conforming inline math library in gnu.gcc for the GNU C
compiler (message-ID <8903230250.AA00243@bayes.arc.nasa.gov>.
--
Diomidis Spinellis European Computer-Industry Research Centre
Arabellastrasse 17, D-8000 Muenchen 81, West Germany +49 (89) 92699199
USA: diomidis%ecrcvax.uucp@pyramid.pyramid.com ...!pyramid!ecrcvax!diomidis
Europe: diomidis@ecrcvax.uucp ...!unido!ecrcvax!diomidis
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.