g77 bug report

Toon Moene toon@moene.indiv.nluug.nl
Tue Nov 30 23:39:00 GMT 1999


N8TM@aol.com wrote:

> In a message dated 11/2/99 7:35:38 AM EST, Jan.van.Eldik@cern.ch writes:

> > Addition of "-ffloat-store" also gives the correct result.

> the resulting array overwrites the input array:
>       CALL ETMUMA(DERA,POIA,POIA)
> ...
>       SUBROUTINE ETMUMA(DER,WGTI,WGTO)
> *   Calcul le produit WGTO = DER(trans)*WGTI*DER
> 
> This is specifically not permitted by the Fortran standards, although this
> practice was followed as a matter of routine for many years.

To check that Tim Prince's analysis is correct you could try compiling
as follows:

$ g77 -O1 -fno-automatic -fargument-alias eldik.f

which indeed gives (over here, using gcc/g77-2.95.2):

$ ./a.out
  102.  13.  3.  153.  21.  231.  29.  6.  46.  10.  226.  33.  343. 
69.  507.

The -fargument-alias option indicates to the compiler that it should
expect actual arguments to subroutines/functions to overlap, contrary to
conformance to the Fortran Standards.

HTH,

-- 
Toon Moene (toon@moene.indiv.nluug.nl)
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Phone: +31 346 214290; Fax: +31 346 214286
GNU Fortran: http://gcc.gnu.org/onlinedocs/g77_news.html



More information about the Gcc-bugs mailing list