This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: g77 bug with ENTRY statement
- To: craig at jcb-sc dot com
- Subject: Re: g77 bug with ENTRY statement
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- Date: Mon, 16 Aug 1999 21:42:42 +0200
- CC: kargl at troutmask dot apl dot washington dot edu, gcc-bugs at egcs dot cygnus dot com
- Organization: Moene Computational Physics, Maartensdijk, The Netherlands
- References: <199908161537.IAA20749@troutmask.apl.washington.edu> <19990816184624.19863.qmail@deer>
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