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

* [Bug fortran/57090] [Fortran-Dev] FAIL: gfortran.dg/alloc_comp_bounds_1.f90  -O*  execution test
  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 ` 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
  2 siblings, 0 replies; 4+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-04-27 21:51 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2013-04-27 21:51:53 UTC ---
If in the reduced test I print also the size of x%ib, the output becomes

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

This also explains the failure of alloc_comp_constructor_1.f90. With the
following changes

--- /opt/gcc/for_work/gcc/testsuite/gfortran.dg/alloc_comp_constructor_1.f90   
2010-04-06 17:08:13.000000000 +0200
+++ alloc_comp_constructor_1_db_2.f90    2013-04-27 23:50:22.000000000 +0200
@@ -40,7 +40,8 @@ Program test_constructor
     if (any(lbound(x%a) /= lbound(y))) call abort()
     if (any(ubound(x%a) /= ubound(y))) call abort()
     if (any(x%a /= y)) call abort()
-    if (size(x%q) /= 2) call abort()
+    print *, size(x%q)
+!    if (size(x%q) /= 2) call abort()
     do i = 1, 2
         if (any(x%q(i)%a /= foo%a)) call abort()
     end do
@@ -81,7 +82,8 @@ contains
         if (any(lbound(x%a) /= lbound(y))) call abort()
         if (any(ubound(x%a) /= ubound(y))) call abort()
         if (any(x%a /= y)) call abort()
-        if (size(x%q) /= 2) call abort()
+    print *, size(x%q)
+!        if (size(x%q) /= 2) call abort()
         do i = 1, 2
             if (any(x%q(i)%a /= foo%a)) call abort()
         end do

the test passes and output

           3
           3


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

* [Bug fortran/57090] [Fortran-Dev] FAIL: gfortran.dg/alloc_comp_bounds_1.f90  -O*  execution test
  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
  2 siblings, 0 replies; 4+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-04-30 11:35 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2013-04-30 11:35:06 UTC ---
*** Bug 57095 has been marked as a duplicate of this bug. ***


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

* [Bug fortran/57090] [Fortran-Dev] FAIL: gfortran.dg/alloc_comp_bounds_1.f90  -O*  execution test
  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
  2 siblings, 0 replies; 4+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-04-30 11:36 UTC (permalink / raw)
  To: gcc-bugs


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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED

--- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2013-04-30 11:36:33 UTC ---
Fixed by revision 198440

Author:    burnus
Date:    Tue Apr 30 08:02:15 2013 UTC (3 hours, 31 minutes ago)
Changed paths:    4
Log Message:    
2013-04-30  Tobias Burnus  <burnus@net-b.de>

        * trans-array.c (gfc_trans_dummy_array_bias, get_std_lbound,
        gfc_alloc_allocatable_for_assignment): Change ubound to extent.
        * trans-expr.c (gfc_trans_alloc_subarray_assign): Ditto.
        * trans-intrinsic.c (gfc_conv_intrinsic_bound): Ditto.


Changed paths

Path    Details
branches/fortran-dev/gcc/fortran/ChangeLog.fortran-dev    modified , text
changed
branches/fortran-dev/gcc/fortran/trans-array.c    modified , text changed
branches/fortran-dev/gcc/fortran/trans-expr.c    modified , text changed
branches/fortran-dev/gcc/fortran/trans-intrinsic.c    modified , text changed

Closing as fixed.


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