This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/30146] Redefining do-variable in excecution cycle
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Mar 2007 19:07:42 -0000
- Subject: [Bug fortran/30146] Redefining do-variable in excecution cycle
- References: <bug-30146-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from burnus at gcc dot gnu dot org 2007-03-21 19:07 -------
(In reply to comment #3)
> The following program causes an infinite loop in gfortran, but not in other
> fortrans.
The program is plainly invalid as one redefines the DO thus your Fortran
compiler is free to do what ever it wants. In addition, your standard violation
cannot be detected at compile time.
gfortran implements it as:
while(1) {
if(i == 1) break;
}
This of cause fails if you change i. As the program is invalid and as I don't
see any possibility to fix this in gfortran, I regard the problem of comment 3
as INVALID/WONTFIX.
For the original example, comment 0, I still think outputting a warning or an
error would be ok. (difference: the original example uses "INTENT(OUT)", the
comment 3 example uses no INTENT - besides, an interface or a host/use
association would be needed too.)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30146