g77 bug with ENTRY statement
Toon Moene
toon@moene.indiv.nluug.nl
Mon Aug 16 12:46:00 GMT 1999
craig@jcb-sc.com wrote:
> Steven Kargl wrote:
> > i=int(z) ! z is no longer in scope.
> Yes it is. Judicious use of GOTOs would make it perfectly okay for
> code literally following the ENTRY in the source to refer to Z. It
> is only because the code flows from that Z-less ENTRY into a reference
> to Z that an undefined behavior is triggered.
> > g77 should issue a warning that z is a dummy argument in
> > subroutine a() and that it is undefined at entry b().
> That'd be great. Ideally the gcc back end would notice this, but the
> way the front end tells it about what's going on basically prevents
> it.
It would indeed be very nice if g77 produced a clear warning here.
Just as a data point: Both SGI's f90 and f77 version 7.2.1. didn't warn
about this construct when using their -ansi options.
Executables produced by both versions of the compiler dumped core in
exactly (as far as possible) the same manner as that generated by g77.
--
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://world.std.com/~burley/g77.html
More information about the Gcc-bugs
mailing list