This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/62106] New: Adding a scalar variable to an array constructor gives wrong result
- From: "m.a.hulsen at tue dot nl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 12 Aug 2014 09:34:21 +0000
- Subject: [Bug fortran/62106] New: Adding a scalar variable to an array constructor gives wrong result
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62106
Bug ID: 62106
Summary: Adding a scalar variable to an array constructor gives
wrong result
Product: gcc
Version: 4.9.2
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: m.a.hulsen at tue dot nl
The following code
program t
integer :: ndim=2, ndfp=4, i
print *, (/ ( i, i = 1, ndfp ) /) + ndim
end program t
gives
1 2 3 4
whereas it should be
3 4 5 6
Note, that both ndfp and ndim need to be variables not constants, in order to
generate the wrong result.