Re: Appropriate methods for argument checking (John R. Grout)
23 Jul 1996 23:27:47 -0400

          From comp.compilers

Related articles
Stack-based IR vs. Register-based IR (Evan Cheng) (1996-07-20)
Appropriate methods for argument checking (William Clodius) (1996-07-22)
Re: Appropriate methods for argument checking (1996-07-23)
Re: Appropriate methods for argument checking (1996-07-26)
Re: Appropriate methods for argument checking (Dara Gallagher) (1996-07-31)
| List of all articles for this month |

From: (John R. Grout)
Newsgroups: comp.compilers
Date: 23 Jul 1996 23:27:47 -0400
Organization: Center for Supercomputing R and D, UIUC
References: 96-07-137 96-07-144
Keywords: Fortran, debug
In-reply-to: William Clodius's message of 22 Jul 1996 10:49:03 -0400

William Clodius <> writes:

> Also as long as I am on the subject of checking the arguments to Fortran's
> procedures, one not unknown problem with Fortran's semantics is a failure of
> some programmers to be aware of all of the no modifiable alias requirements
> for its arguments.

The aliasing rule is a very important advantage for F77 code generation...
without it, C and C++ compilers get blown away on many scientific programs
(and need some sort of interprocedural analysis to even come close to F77
without interprocedural analysis).

Our Polaris research group has also observed the value of the F77 aliasing
rule for parallelizing compilers. For example, in a number of Perfect Club
F77 programs, Polaris can only parallelize a loop in a called subprogram by
using the aliasing rule... when (by inlining) it brings in interprocedural
information to double-check whether or not aliasing is actually going on,
the resulting dependence problems are full of nasty symbolic expressions and
Polaris (which, we'd like to believe, has state-of-the-art symbolic
capabilities) can't break the associated dependence arcs.

With some misgivings, our group plans to use the aliasing rule to help
parallelize some of these loops in an interprocedural environment. Though
we are concerned that some programs don't actually observe the aliasing
rule, we've had to deal with this kind of standard-violating behavior before
(programs which pass a part of a REAL array at a symbolic offset to a DOUBLE
parameter, making compile-time alignment checking impossible), and so we've
fallen back on trying not to do worse on such programs than existing
intra-procedural compilers.

> Checking that the code satisfied this requirement did not appear to be
> practical under F77.
> ...
> [I believe that perfect alias checking is equivalent to the insoluble halting
> problem,

Even at run time?

> but there should be some useful heuristics.

From our experiences, I wonder how useful link-time heuristics would be...
there are certainly programs out there for which they'd say "I don't know"
(if programs were reevaluated with key input values pre-specified at "bind
time", as DB schemas are in some data base management systems, maybe we'd do

> Fortran doesn't make it easy, since the aliasing rule is applied element by
> element, not array by array. -John]

Given the primitive (but efficient) data structures and parameter passing in
F77, and the lack of dynamic data allocation, I doubt any useful aliasing
rule which was not element by element would be possible... which leaves us
with all the limitations mentioned above.
John R. Grout Center for Supercomputing R & D
Coordinated Science Laboratory University of Illinois at Urbana-Champaign

Post a followup to this message

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