This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/62106] New: Adding a scalar variable to an array constructor gives wrong result


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]