[Bug fortran/88467] New: Silently accepts wrong array constructor
gscfq@t-online.de
gcc-bugzilla@gcc.gnu.org
Wed Dec 12 16:55:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88467
Bug ID: 88467
Summary: Silently accepts wrong array constructor
Product: gcc
Version: 9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gscfq@t-online.de
Target Milestone: ---
Extracted from pr88116. Silently accepts these array
constructors and consequently prints wrong results :
$ cat z1.f90
program p
print *, [integer :: 1, [integer(1) :: '3', 4]]
print *, [integer :: 1, [integer(2) :: '3', 4]]
print *, [integer :: 1, [integer(8) :: '3', 4]]
print *, [integer :: 1, [integer(16) :: '3', 4]]
end
$ cat z2.f90
program p
print *, [integer :: 1, [integer(1) :: 2, '3']]
print *, [integer :: 1, [integer(2) :: 2, '3']]
print *, [integer :: 1, [integer(8) :: 2, '3']]
print *, [integer :: 1, [integer(16) :: 2, '3']]
end
$ cat z3.f90
program p
print *, [integer(8) :: 1, [integer(4) :: 2, '3']]
end
$ gfortran-9-20181209 z1.f90 -static-libgfortran
$ a.out
1 0 4
1 0 4
1 0 4
1 0 4
$ gfortran-9-20181209 z3.f90 -static-libgfortran
$ a.out
1 2 0
$
More information about the Gcc-bugs
mailing list