Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: lovell@sdr.slb.com (John Lovell)
Subject: Re: VMS on Alpha anyone?
Date: Sat, 4 Sep 1993 21:52:20 GMT	[thread overview]
Message-ID: <CCunF9.BL7@sdr.slb.com> (raw)
In-Reply-To: 26acod$vq@jac.nuo.dec.com

In article vq@jac.nuo.dec.com, lionel@quark.enet.dec.com (Steve Lionel) writes:
>
>In article <CCswuL.6B8@sdr.slb.com>, lovell@sdr.slb.com (John Lovell) writes...
>> 
>>Codes will blindly recompile but you should probably use the flag 
>>/assume = "dummy_aliases" to get the right answer (if you HAVE dummy aliases
>>(you probably do) and you use the default /assume = "no_dummy_aliases" 
>>then you get REALLY tricky bugs to debug, especially if you use complex 
>>numbers!!)
>> 
>Well, actually, most applications don't have dummy aliases.  This is when
>you do something like this:
>
>	CALL FOO (A,A)
>	...
>	SUBROUTINE FOO (X,Y)
>	...
>
>The compiler wants to assume that modifications to one variable don't
>modify others (unless it can see the dependence via EQUIVALENCE) - the
>FORTRAN-77 standard forbids aliasing between arguments and between 
>arguments and COMMON variables.   By assuming that the standard rules
>are being followed, which in most cases is true, the compiler has many
>more optimization opportunities open to it.  This assumption is also the
>case in the VAX compiler as of V6; prior to that, the compiler didn't do
>any optimization of arguments (or COMMON variables).
>
>Nit: the spelling of the keyword is NODUMMY_ALIASES.  This can be specified
>in an OPTIONS statement if you determine that your program depends on
>this setting to work.
>

Yes, routinely sloppy programming on my part, I'm afraid. E.g, if I had a 
subroutine CFOO(Z,A,X,Y,N) to compute Z := A.X+Y with X, Y and Z complex N-vectors
and A a complex scalar, I would call this routine as CFOO(X,A,X,Y,N) if I wanted
X := A.X+Y (thereby violating the FORTRAN standard).

With /assume=dummy_aliases the answer WILL be wrong because the compiler (correctly)
is free to make the assumption that it can compute REAL(Z(k)) before AIMAG(Z(k)),
which saves having to use a temporary variable in Z(k) = A*X(k)+Y(k) but if
Z and X are the same "dummy" variable then the result will clearly be not what the
user expected!

Regards,

John

>Steve Lionel                           lionel@quark.enet.dec.com
>SDT Languages Group
>Digital Equipment Corporation
>110 Spit Brook Road
>Nashua, NH 03062                       "Free advice is worth every cent"






  reply	other threads:[~1993-09-04 21:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-09-02 20:11 VMS on Alpha anyone? Tor Arntsen
1993-09-03 13:18 ` Ken Cowan
1993-09-03 14:01   ` finger
1993-09-03 15:08 ` Steve Lionel
1993-09-03 23:20 ` John Lovell
1993-09-04 15:20   ` Steve Lionel
1993-09-04 21:52     ` John Lovell [this message]
1993-09-05  2:56 ` Fred Velijanian
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox