public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/57090] New: FAIL: gfortran.dg/alloc_comp_bounds_1.f90  -O*  execution test
@ 2013-04-27 13:56 dominiq at lps dot ens.fr
  2013-04-27 21:51 ` [Bug fortran/57090] [Fortran-Dev] " dominiq at lps dot ens.fr
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-04-27 13:56 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57090

             Bug #: 57090
           Summary: FAIL: gfortran.dg/alloc_comp_bounds_1.f90  -O*
                    execution test
    Classification: Unclassified
           Product: gcc
           Version: fortran-dev
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: dominiq@lps.ens.fr
                CC: burnus@gcc.gnu.org


The test gfortran.dg/alloc_comp_bounds_1.f90 fails when compile with the
fortran-dev branch. Reduced test:

  integer, parameter :: ik4 = 4
  integer, parameter :: ik8 = 8
  integer, parameter :: from = -1, to = 2
  call foo
  call bar
contains
  subroutine foo
    type :: struct
      integer(4), allocatable :: ib(:)
    end type struct
    integer(ik4), allocatable :: ia(:)
    type(struct) :: x
    allocate(ia(from:to))
    x=struct(ia(:))
    print *, lbound(x%ib), ubound(x%ib), "  expected  1 4"
!    if (any(lbound(x%ib) .ne. 1) .or. any(ubound(x%ib) .ne. 4)) call abort
    deallocate(ia)
  end subroutine
  subroutine bar
    type :: struct
      integer(4), allocatable :: ib(:)
    end type struct
    integer(ik8), allocatable :: ia(:)
    type(struct) :: x
    allocate(ia(from:to))
    x=struct(ia)
    print *, lbound(x%ib), ubound(x%ib), "  expected -1 2"
!    if (any(lbound(x%ib) .ne. -1) .or. any(ubound(x%ib) .ne. 2)) call abort
    x=struct(ia(:))
    print *, lbound(x%ib), ubound(x%ib), "  expected  1 4"
!    if (any(lbound(x%ib) .ne. 1) .or. any(ubound(x%ib) .ne. 4)) call abort
    x=struct(ia(from:to))
    print *, lbound(x%ib), ubound(x%ib), "  expected  1 4"
!    if (any(lbound(x%ib) .ne. 1) .or. any(ubound(x%ib) .ne. 4)) call abort
    deallocate(ia)
  end subroutine
end

output

           1           6   expected  1 4
          -1           1   expected -1 2
           1           5   expected  1 4
           1           5   expected  1 4


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-04-30 11:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-27 13:56 [Bug fortran/57090] New: FAIL: gfortran.dg/alloc_comp_bounds_1.f90 -O* execution test dominiq at lps dot ens.fr
2013-04-27 21:51 ` [Bug fortran/57090] [Fortran-Dev] " dominiq at lps dot ens.fr
2013-04-30 11:35 ` dominiq at lps dot ens.fr
2013-04-30 11:36 ` dominiq at lps dot ens.fr

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).