https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87580

            Bug ID: 87580
           Summary: Wrong bounds for sourced allocated array
           Product: gcc
           Version: 8.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: antony at cosmologist dot info
  Target Milestone: ---

Bounds of vec2 are wrong in this example (0, 9) instead of (1, 10) as expected
(which can lead to all sorts of wrong results). Also in 6.4.

    program tester
    real(kind(1.d0)), allocatable ::  vec2(:)
    real(kind(1.d0)) vec(10)

    allocate(vec2, source=vec*2.)
    print *, lbound(vec), ubound(vec)
    print *, lbound(vec2), ubound(vec2)

    end program tester

Reply via email to