public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/54958] New: Wrongly rejects ac-implied-DO variables which also occur with INTENT(IN)
@ 2012-10-17 19:16 burnus at gcc dot gnu.org
2012-10-28 16:57 ` [Bug fortran/54958] " burnus at gcc dot gnu.org
2012-10-28 18:25 ` burnus at gcc dot gnu.org
0 siblings, 2 replies; 3+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-10-17 19:16 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54958
Bug #: 54958
Summary: Wrongly rejects ac-implied-DO variables which also
occur with INTENT(IN)
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: burnus@gcc.gnu.org
gfortran rejects all four uses of "i" in the following program with
Error: Dummy argument 'i' with INTENT(IN) in variable definition context
(iterator variable) at (1)
However, it should only reject the use as variable in io-implied-do and in the
do-stmt and not the (ac-,data-)implied-do variable. Cf. IR 000076 at
ftp://ftp.nag.co.uk/sc22wg5/n1351-n1400/N1393.txt
g95, pathf95 and NAG properly handle this case, gfortran 4.1 to 4.8 doesn't.
subroutine test(i)
integer, intent(in) :: i
integer :: A(5)
! Valid: data-implied-do [WRONGLY rejected by gfortran]
DATA (A(i), i=1,5)/5*42/
! Valid: ac-implied-do [WRONGLY rejected by gfortran]
print *, [(i, i=1,5 )]
! Invalid: io-implied-do [OK: rejected by gfortran]
print *, (i, i=1,5 )
! Invalid: do-variable in a do-stmt [OK: rejected by gfortran]
do i = 1, 5
end do
end
>From the standard (F2008):
"C539 (R523) A nonpointer object with the INTENT (IN) attribute shall not
appear in a variable definition context (16.6.7)."
and in "16.6.7 Variable definition context":
"(4) a do-variable in a do-stmt or io-implied-do;"
The reason that a data-implied-do and ac-implied-do is allowed is given at
"16.4 Statement and construct entities":
"The name of a data-i-do-variable in a DATA statement or an ac-do-variable in
an array constructor has a scope of its data-implied-do or ac-implied-do. [...]
The appearance of a name as a data-i-do-variable of an implied DO in a DATA
statement or an ac-do-variable in an array constructor is not an implicit
declaration of a variable whose scope is the scoping unit that contains the
statement."
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug fortran/54958] Wrongly rejects ac-implied-DO variables which also occur with INTENT(IN)
2012-10-17 19:16 [Bug fortran/54958] New: Wrongly rejects ac-implied-DO variables which also occur with INTENT(IN) burnus at gcc dot gnu.org
@ 2012-10-28 16:57 ` burnus at gcc dot gnu.org
2012-10-28 18:25 ` burnus at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-10-28 16:57 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54958
--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-10-28 16:57:15 UTC ---
Author: burnus
Date: Sun Oct 28 16:57:12 2012
New Revision: 192896
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=192896
Log:
2012-10-28 Tobias Burnus <burnus@net-b.de>
PR fortran/54958
* gfortran.h (gfc_resolve_iterator_expr,
gfc_check_vardef_context): Update prototype.
* expr.c (gfc_check_vardef_context): Add own_scope
argument and honour it.
* resolve.c (gfc_resolve_iterator_expr): Add own_scope
argument and honour it.
(resolve_deallocate_expr, resolve_allocate_expr,
resolve_data_variables, resolve_transfer
resolve_lock_unlock, resolve_code): Update calls.
* array.c (resolve_array_list): Ditto.
* check.c (gfc_check_atomic_def, gfc_check_atomic_ref): Ditto.
* interface.c (compare_actual_formal): Ditto.
* intrinsic.c (check_arglist): Ditto.
* io.c (resolve_tag, gfc_resolve_dt, gfc_resolve_inquire):
* Ditto.
2012-10-28 Tobias Burnus <burnus@net-b.de>
PR fortran/54958
* gfortran.dg/do_check_6.f90: New.
Added:
trunk/gcc/testsuite/gfortran.dg/do_check_6.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/array.c
trunk/gcc/fortran/check.c
trunk/gcc/fortran/expr.c
trunk/gcc/fortran/gfortran.h
trunk/gcc/fortran/interface.c
trunk/gcc/fortran/intrinsic.c
trunk/gcc/fortran/io.c
trunk/gcc/fortran/resolve.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug fortran/54958] Wrongly rejects ac-implied-DO variables which also occur with INTENT(IN)
2012-10-17 19:16 [Bug fortran/54958] New: Wrongly rejects ac-implied-DO variables which also occur with INTENT(IN) burnus at gcc dot gnu.org
2012-10-28 16:57 ` [Bug fortran/54958] " burnus at gcc dot gnu.org
@ 2012-10-28 18:25 ` burnus at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-10-28 18:25 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54958
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
CC| |burnus at gcc dot gnu.org
Resolution| |FIXED
--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-10-28 18:25:19 UTC ---
FIXED on the 4.8 trunk.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-10-28 18:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-17 19:16 [Bug fortran/54958] New: Wrongly rejects ac-implied-DO variables which also occur with INTENT(IN) burnus at gcc dot gnu.org
2012-10-28 16:57 ` [Bug fortran/54958] " burnus at gcc dot gnu.org
2012-10-28 18:25 ` burnus at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).