Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!sun-barr!decwrl!decvax!ima!compilers-sender From: diomidis@ecrcvax.UUCP (Diomidis Spinellis) Newsgroups: comp.compilers Subject: Re: Encripted source as an ANDF (really FORTRAN vs C optimization) Summary: ANSI C allows some more optimisiations than traditional C Keywords: FORTRAN C optimization trigonometric loop Message-ID: <4044@ima.ima.isc.com> Date: 10 Jun 89 00:55:22 GMT References: <4001@ima.ima.isc.com> Sender: compilers-sender@ima.ima.isc.com Reply-To: diomidis@ecrcvax.UUCP (Diomidis Spinellis) Organization: ECRC, Munich 81, West Germany Lines: 38 Approved: compilers@ima.UUCP 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 -- Send compilers articles to compilers@ima.isc.com or, perhaps, Levine@YALE.EDU Plausible paths are { decvax | harvard | yale | bbn}!ima Please send responses to the originator of the message -- I cannot forward mail accidentally sent back to compilers. Meta-mail to ima!compilers-request