public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/102369] New: VALUE attribute for arrays not allowed
@ 2021-09-16 15:02 longb at cray dot com
2021-09-16 15:05 ` [Bug fortran/102369] " longb at cray dot com
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: longb at cray dot com @ 2021-09-16 15:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102369
Bug ID: 102369
Summary: VALUE attribute for arrays not allowed
Product: gcc
Version: 11.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: longb at cray dot com
Target Milestone: ---
> cat test.f90
module mymod
contains
pure real function myfunc(x)
integer, value, dimension(:), intent(in) :: x
myfunc = x(1)
end function myfunc
end module mymod
program main
use mymod
implicit none
integer, parameter :: sz = 10
integer, dimension(sz) :: foo
foo = 42
print *, myfunc(foo)
end program main
> ifort test.f90
> ./a.out
42.00000
> gfortran test.f90
test.f90:4:14:
4 | integer, value, dimension(:), intent(in) :: x
| 1
Error: VALUE attribute conflicts with DIMENSION attribute at (1)
test.f90:3:27:
3 | pure real function myfunc(x)
| 1
Error: Dummy procedure 'x' of PURE procedure at (1) must also be PURE
test.f90:5:9:
5 | myfunc = x(1)
| 1
Error: Reference to impure function 'x' at (1) within a PURE procedure
test.f90:9:5:
9 | use mymod
| 1
Fatal Error: Cannot open module file 'mymod.mod' for reading at (1): No such
file or directory
compilation terminated.
> gfortran --version
GNU Fortran (GCC) 11.2.0 20210728 (Cray Inc.)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug fortran/102369] VALUE attribute for arrays not allowed
2021-09-16 15:02 [Bug fortran/102369] New: VALUE attribute for arrays not allowed longb at cray dot com
@ 2021-09-16 15:05 ` longb at cray dot com
2021-09-16 18:50 ` anlauf at gcc dot gnu.org
2022-02-17 20:03 ` anlauf at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: longb at cray dot com @ 2021-09-16 15:05 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102369
--- Comment #1 from Bill Long <longb at cray dot com> ---
I assume the cascade of error messages all originate with the first one. The
combination of VALUE for an array is allowed in F08 and later versions.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug fortran/102369] VALUE attribute for arrays not allowed
2021-09-16 15:02 [Bug fortran/102369] New: VALUE attribute for arrays not allowed longb at cray dot com
2021-09-16 15:05 ` [Bug fortran/102369] " longb at cray dot com
@ 2021-09-16 18:50 ` anlauf at gcc dot gnu.org
2022-02-17 20:03 ` anlauf at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-09-16 18:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102369
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |rejects-valid
Status|UNCONFIRMED |NEW
Last reconfirmed| |2021-09-16
Ever confirmed|0 |1
--- Comment #2 from anlauf at gcc dot gnu.org ---
Confirmed.
F2018: 8.5.18 VALUE attribute
C863 An entity with the VALUE attribute shall be a dummy data object. It shall
not be an assumed-size array, a coarray, or a variable with a coarray ultimate
component.
Thus assumed-shape is allowed. We need to adjust the checks.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug fortran/102369] VALUE attribute for arrays not allowed
2021-09-16 15:02 [Bug fortran/102369] New: VALUE attribute for arrays not allowed longb at cray dot com
2021-09-16 15:05 ` [Bug fortran/102369] " longb at cray dot com
2021-09-16 18:50 ` anlauf at gcc dot gnu.org
@ 2022-02-17 20:03 ` anlauf at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: anlauf at gcc dot gnu.org @ 2022-02-17 20:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102369
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |a.shahmoradi at gmail dot com
--- Comment #3 from anlauf at gcc dot gnu.org ---
*** Bug 104585 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-02-17 20:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-16 15:02 [Bug fortran/102369] New: VALUE attribute for arrays not allowed longb at cray dot com
2021-09-16 15:05 ` [Bug fortran/102369] " longb at cray dot com
2021-09-16 18:50 ` anlauf at gcc dot gnu.org
2022-02-17 20:03 ` anlauf 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).