constant expressions

glen herrmannsfeldt <gah@ugcs.caltech.edu>
Tue, 13 Jan 2009 21:52:11 +0000 (UTC)

          From comp.compilers

Related articles
constant expressions gah@ugcs.caltech.edu (glen herrmannsfeldt) (2009-01-13)
Re: constant expressions DrDiettrich1@aol.com (Hans-Peter Diettrich) (2009-01-15)
Re: constant expressions gneuner2@comcast.net (George Neuner) (2009-01-16)
| List of all articles for this month |
From: glen herrmannsfeldt <gah@ugcs.caltech.edu>
Newsgroups: comp.compilers
Date: Tue, 13 Jan 2009 21:52:11 +0000 (UTC)
Organization: California Institute of Technology, Pasadena
Keywords: code, optimize, question, comment
Posted-Date: 14 Jan 2009 20:08:03 EST

In a discussion on comp.lang.fortran regarding the Fortran PARAMETER
there is the question of compile time evaluation of constant
expressions, including the question of array expressions.


I know compilers have done compile time evaluation of scalar constant
expressions for many years. I wonder about the state of the art in
compile time evaluation of constant array expressions. I would
include the case of arrays in initialized variables that are known at
compile time not to change. Do any compilers now do compile time
evaluation of complicated array expressions?


It seems that compilation of array expressions in general is
improving, but that there is still room for improvement. One common
question in comp.lang.fortran has to do with the execution time of an
array expression compared to one using DO loops. In many cases the
array expression is much slower, often using temporary arrays not
needed in the DO case.


-- glen
[Sheesh. I turned array expressions into do loops (well, Basic for loops)
in the compiler I wrote for my first compiler course in 1972. It's not
that hard. -John]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.