[Bug fortran/44354] implied do loop with its own variable name as upper bound

2012-07-26 Thread mikael at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44354

--- Comment #23 from Mikael Morin mikael at gcc dot gnu.org 2012-07-26 
08:47:42 UTC ---
Author: mikael
Date: Thu Jul 26 08:47:33 2012
New Revision: 189882

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=189882
Log:
fortran/
PR fortran/44354
* array.c (sought_symbol): New variable.
(expr_is_sought_symbol_ref, find_symbol_in_expr): New functions.
(resolve_array_list): Check for references to the induction
variable in the iteration bounds and issue a diagnostic if some
are found.

testsuite/
PR fortran/44354
* gfortran.dg/array_constructor_38.f90: New test.



Added:
trunk/gcc/testsuite/gfortran.dg/array_constructor_38.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/array.c
trunk/gcc/testsuite/ChangeLog


[Bug fortran/44354] implied do loop with its own variable name as upper bound

2012-07-26 Thread mikael at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44354

--- Comment #24 from Mikael Morin mikael at gcc dot gnu.org 2012-07-26 
08:54:02 UTC ---
Author: mikael
Date: Thu Jul 26 08:53:56 2012
New Revision: 189883

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=189883
Log:
fortran/
PR fortran/44354
* trans-array.c (gfc_trans_array_constructor_value):
Evaluate the iteration bounds before the inner variable shadows
the outer.

testsuite/
PR fortran/44354
* gfortran.dg/array_constructor_39.f90: New test.


Added:
trunk/gcc/testsuite/gfortran.dg/array_constructor_39.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/trans-array.c
trunk/gcc/testsuite/ChangeLog


[Bug fortran/44354] implied do loop with its own variable name as upper bound

2012-07-26 Thread mikael at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44354

Mikael Morin mikael at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED
  Known to fail||

--- Comment #25 from Mikael Morin mikael at gcc dot gnu.org 2012-07-26 
09:04:09 UTC ---
The code in comment 0 now gives the expected output:
   1   2   3   4   5

It is accepted by default with a warning.
It is rejected with -std=f{95,2003,2008}.

Thus, (finally) fixed for 4.8.0.


[Bug fortran/44354] implied do loop with its own variable name as upper bound

2010-07-28 Thread mikael at gcc dot gnu dot org


-- 

mikael at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |mikael at gcc dot gnu dot
   |dot org |org
 Status|NEW |ASSIGNED
   Last reconfirmed|2010-05-31 18:04:29 |2010-07-28 20:53:59
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44354



[Bug fortran/44354] implied do loop with its own variable name as upper bound

2010-06-07 Thread tkoenig at gcc dot gnu dot org


--- Comment #22 from tkoenig at gcc dot gnu dot org  2010-06-07 18:11 
---
Adjusting subject, setting severity to enhancement and
adding diagnostic keyword.(In reply to comment #21)
 (In reply to comment #18)
  Expected:
  a) Allow it as extension (-std=gnu or -std=legacy; especially, for -std=gnu 
  one
  could consider a default-enabled warning)
  b) Reject it for -std=f(95,2003,2008)
 
 I'd vote to reject it for any -std=*. This extension just asks for trouble.

I concur.  I would also favor a warning at least for -Wuninitialized.


-- 

tkoenig at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||tkoenig at gcc dot gnu dot
   ||org
   Severity|normal  |enhancement
   Keywords||diagnostic
Summary|incorrect output at run time|implied do loop with its own
   ||variable name as upper bound


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44354