public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/23446] New: Valid internal subprogram array argument declaration is not accepted.
@ 2005-08-17 17:05 enok at lysator dot liu dot se
2005-08-17 17:08 ` [Bug fortran/23446] " enok at lysator dot liu dot se
` (4 more replies)
0 siblings, 5 replies; 9+ messages in thread
From: enok at lysator dot liu dot se @ 2005-08-17 17:05 UTC (permalink / raw)
To: gcc-bugs
I'm trying to declare an internal subprogram array argument size using a local
variable inherited from the encompassing scope.
I think the declaration looks legal, but I'm not 100% sure. I just know that
many other compilers accepts it without warnings but gfortran says it's an error.
--
Summary: Valid internal subprogram array argument declaration is
not accepted.
Product: gcc
Version: 4.0.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: enok at lysator dot liu dot se
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: 86_64-unknown-linux-gnu
GCC host triplet: 86_64-unknown-linux-gnu
GCC target triplet: 86_64-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23446
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/23446] Valid internal subprogram array argument declaration is not accepted.
2005-08-17 17:05 [Bug fortran/23446] New: Valid internal subprogram array argument declaration is not accepted enok at lysator dot liu dot se
@ 2005-08-17 17:08 ` enok at lysator dot liu dot se
2005-08-18 3:20 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: enok at lysator dot liu dot se @ 2005-08-17 17:08 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From enok at lysator dot liu dot se 2005-08-17 17:07 -------
Created an attachment (id=9521)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9521&action=view)
Testcase that is accepted by other compilers, but rejected by gfortran.
The output from gfortran follows:
> gfortran -c tst.f90
In file tst.f90:10
INTEGER A(IMAX)
1
Error: Variable 'imax' cannot appear in the expression at (1)
>
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23446
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/23446] Valid internal subprogram array argument declaration is not accepted.
2005-08-17 17:05 [Bug fortran/23446] New: Valid internal subprogram array argument declaration is not accepted enok at lysator dot liu dot se
2005-08-17 17:08 ` [Bug fortran/23446] " enok at lysator dot liu dot se
@ 2005-08-18 3:20 ` pinskia at gcc dot gnu dot org
2005-08-18 7:55 ` enok at lysator dot liu dot se
` (2 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-18 3:20 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
GCC build triplet|86_64-unknown-linux-gnu |
GCC host triplet|86_64-unknown-linux-gnu |
GCC target triplet|86_64-unknown-linux-gnu |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23446
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/23446] Valid internal subprogram array argument declaration is not accepted.
2005-08-17 17:05 [Bug fortran/23446] New: Valid internal subprogram array argument declaration is not accepted enok at lysator dot liu dot se
2005-08-17 17:08 ` [Bug fortran/23446] " enok at lysator dot liu dot se
2005-08-18 3:20 ` pinskia at gcc dot gnu dot org
@ 2005-08-18 7:55 ` enok at lysator dot liu dot se
2005-08-30 15:23 ` fxcoudert at gcc dot gnu dot org
2005-09-26 19:24 ` pault at gcc dot gnu dot org
4 siblings, 0 replies; 9+ messages in thread
From: enok at lysator dot liu dot se @ 2005-08-18 7:55 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 424 bytes --]
------- Additional Comments From enok at lysator dot liu dot se 2005-08-18 07:42 -------
After some research, I'm pretty sure the rejected code is legal.
§734: A specification-expr is a scalar-int-expr
Constraint: The scalar-int-expr shall be a restricted expression
Since "a variable from the host program unit" is a restricted expression the
code is valid.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23446
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/23446] Valid internal subprogram array argument declaration is not accepted.
2005-08-17 17:05 [Bug fortran/23446] New: Valid internal subprogram array argument declaration is not accepted enok at lysator dot liu dot se
` (2 preceding siblings ...)
2005-08-18 7:55 ` enok at lysator dot liu dot se
@ 2005-08-30 15:23 ` fxcoudert at gcc dot gnu dot org
2005-09-26 19:24 ` pault at gcc dot gnu dot org
4 siblings, 0 replies; 9+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2005-08-30 15:23 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From fxcoudert at gcc dot gnu dot org 2005-08-30 15:10 -------
Confirmed, as I think this is indeed legal code.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2005-08-30 15:10:01
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23446
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/23446] Valid internal subprogram array argument declaration is not accepted.
2005-08-17 17:05 [Bug fortran/23446] New: Valid internal subprogram array argument declaration is not accepted enok at lysator dot liu dot se
` (3 preceding siblings ...)
2005-08-30 15:23 ` fxcoudert at gcc dot gnu dot org
@ 2005-09-26 19:24 ` pault at gcc dot gnu dot org
4 siblings, 0 replies; 9+ messages in thread
From: pault at gcc dot gnu dot org @ 2005-09-26 19:24 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pault at gcc dot gnu dot org 2005-09-26 19:24 -------
Patch posted on fortran list:
http://gcc.gnu.org/ml/fortran/2005-09/msg00400.html
Paul T
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23446
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/23446] Valid internal subprogram array argument declaration is not accepted.
[not found] <bug-23446-7816@http.gcc.gnu.org/bugzilla/>
2005-10-17 20:52 ` cvs-commit at gcc dot gnu dot org
2005-10-18 5:55 ` cvs-commit at gcc dot gnu dot org
@ 2005-10-18 14:21 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-18 14:21 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from pinskia at gcc dot gnu dot org 2005-10-18 14:21 -------
Fixed.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.0.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23446
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/23446] Valid internal subprogram array argument declaration is not accepted.
[not found] <bug-23446-7816@http.gcc.gnu.org/bugzilla/>
2005-10-17 20:52 ` cvs-commit at gcc dot gnu dot org
@ 2005-10-18 5:55 ` cvs-commit at gcc dot gnu dot org
2005-10-18 14:21 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-10-18 5:55 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from cvs-commit at gcc dot gnu dot org 2005-10-18 05:55 -------
Subject: Bug 23446
CVSROOT: /cvs/gcc
Module name: gcc
Branch: gcc-4_0-branch
Changes by: pault@gcc.gnu.org 2005-10-18 05:55:23
Modified files:
gcc/fortran : ChangeLog gfortran.h resolve.c expr.c decl.c
match.c
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/gfortran.dg: host_dummy_index_1.f90
automatic_char_len_2.f90
recursive_statement_functions.f90
assumed_size_dt_dummy.f90
external_initializer.f90
non_module_public.f90
Log message:
2005-10-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/23446
* gfortran.h: Primitive for gfc_is_formal_arg.
* resolve.c(gfc_is_formal_arg): New function to signal across
several function calls that formal argument lists are being
processed.
(resolve_formal_arglist): Set/reset the flag for gfc_is_formal_arg.
*expr.c(check_restricted): Add check, via gfc_is_formal_arg, if
symbol is part of an formal argument declaration.
PR fortran/21459
* decl.c (add_init_expr_to_sym): Make a new character
length for each variable, when the expression is NULL
and link to cl_list.
PR fortran/20866
* match.c (recursive_stmt_fcn): New function that tests if
a statement function resurses through itself or other other
statement functions.
(gfc_match_st_function): Call recursive_stmt_fcn to check
if this is recursive and to raise error if so.
PR fortran/20849
PR fortran/20853
* resolve.c (resolve_symbol): Errors for assumed size arrays
with default initializer and for external objects with an
initializer.
PR fortran/20837
* decl.c (match_attr_spec): Prevent PUBLIC from being used
outside a module.
2005-10-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/23446
* gfortran.dg/host_dummy_index_1.f90: New test.
PR fortran/21459
gfortran.dg/automatic_char_len_2.f90: New test.
PR fortran/20866
gfortran.dg/recursive_statement_functions.f90: New test.
PR fortran/20853
gfortran.dg/assumed_size_dt_dummy.f90: New test.
PR fortran/20849
gfortran.dg/external_initializer.f90: New test.
PR fortran/20837
non_module_public.f90: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.335.2.130&r2=1.335.2.131
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/gfortran.h.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.58.2.18&r2=1.58.2.19
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/resolve.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.34.2.18&r2=1.34.2.19
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/expr.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.23.2.4&r2=1.23.2.5
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/decl.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.31.2.5&r2=1.31.2.6
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/match.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.31.8.13&r2=1.31.8.14
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.465&r2=1.5084.2.466
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/host_dummy_index_1.f90.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/automatic_char_len_2.f90.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/recursive_statement_functions.f90.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/assumed_size_dt_dummy.f90.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/external_initializer.f90.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/non_module_public.f90.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23446
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/23446] Valid internal subprogram array argument declaration is not accepted.
[not found] <bug-23446-7816@http.gcc.gnu.org/bugzilla/>
@ 2005-10-17 20:52 ` cvs-commit at gcc dot gnu dot org
2005-10-18 5:55 ` cvs-commit at gcc dot gnu dot org
2005-10-18 14:21 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-10-17 20:52 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from cvs-commit at gcc dot gnu dot org 2005-10-17 20:52 -------
Subject: Bug 23446
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: pault@gcc.gnu.org 2005-10-17 20:52:37
Modified files:
gcc/fortran : ChangeLog gfortran.h resolve.c expr.c decl.c
match.c
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/gfortran.dg: host_dummy_index_1.f90
automatic_char_len_2.f90
recursive_statement_functions.f90
assumed_size_dt_dummy.f90
external_initializer.f90
non_module_public.f90
Log message:
2005-10-17 Paul Thomas <pault@gcc.gnu.org>
PR fortran/23446
* gfortran.h: Primitive for gfc_is_formal_arg.
* resolve.c(gfc_is_formal_arg): New function to signal across
several function calls that formal argument lists are being
processed.
(resolve_formal_arglist): Set/reset the flag for gfc_is_formal_arg.
*expr.c(check_restricted): Add check, via gfc_is_formal_arg, if
symbol is part of an formal argument declaration.
PR fortran/21459
* decl.c (add_init_expr_to_sym): Make a new character
length for each variable, when the expression is NULL
and link to cl_list.
PR fortran/20866
* match.c (recursive_stmt_fcn): New function that tests if
a statement function resurses through itself or other other
statement functions.
(gfc_match_st_function): Call recursive_stmt_fcn to check
if this is recursive and to raise error if so.
PR fortran/20849
PR fortran/20853
* resolve.c (resolve_symbol): Errors for assumed size arrays
with default initializer and for external objects with an
initializer.
PR fortran/20837
* decl.c (match_attr_spec): Prevent PUBLIC from being used
outside a module.
2005-10-17 Paul Thomas <pault@gcc.gnu.org>
PR fortran/23446
* gfortran.dg/host_dummy_index_1.f90: New test.
PR fortran/21459
gfortran.dg/automatic_char_len_2.f90: New test.
PR fortran/20866
gfortran.dg/recursive_statement_functions.f90: New test.
PR fortran/20853
gfortran.dg/assumed_size_dt_dummy.f90: New test.
PR fortran/20849
gfortran.dg/external_initializer.f90: New test.
PR fortran/20837
non_module_public.f90: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&r1=1.587&r2=1.588
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/gfortran.h.diff?cvsroot=gcc&r1=1.89&r2=1.90
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/resolve.c.diff?cvsroot=gcc&r1=1.59&r2=1.60
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/expr.c.diff?cvsroot=gcc&r1=1.30&r2=1.31
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/decl.c.diff?cvsroot=gcc&r1=1.42&r2=1.43
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/match.c.diff?cvsroot=gcc&r1=1.46&r2=1.47
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.6205&r2=1.6206
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/host_dummy_index_1.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/automatic_char_len_2.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/recursive_statement_functions.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/assumed_size_dt_dummy.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/external_initializer.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/non_module_public.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23446
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2005-10-18 14:21 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-17 17:05 [Bug fortran/23446] New: Valid internal subprogram array argument declaration is not accepted enok at lysator dot liu dot se
2005-08-17 17:08 ` [Bug fortran/23446] " enok at lysator dot liu dot se
2005-08-18 3:20 ` pinskia at gcc dot gnu dot org
2005-08-18 7:55 ` enok at lysator dot liu dot se
2005-08-30 15:23 ` fxcoudert at gcc dot gnu dot org
2005-09-26 19:24 ` pault at gcc dot gnu dot org
[not found] <bug-23446-7816@http.gcc.gnu.org/bugzilla/>
2005-10-17 20:52 ` cvs-commit at gcc dot gnu dot org
2005-10-18 5:55 ` cvs-commit at gcc dot gnu dot org
2005-10-18 14:21 ` pinskia at gcc dot gnu dot 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).