This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

Re: PR fortran/18899: ubound() failing for assumed-shape arrays


> > + contains
> > +   subroutine test (b)
> > +     integer, dimension (11:, -8:), target :: b
> > +
> > +     if (lbound (b, 1) .ne. 11) call abort
> > +     if (ubound (b, 1) .ne. 50) call abort
> > +     if (lbound (b, 2) .ne. -8) call abort
> > +     if (ubound (b, 2) .ne. 71) call abort
> > +
> > +     if (lbound (b (:, :), 1) .ne. 1) call abort
> > +     if (ubound (b (:, :), 1) .ne. 40) call abort
> > +     if (lbound (b (:, :), 2) .ne. 1) call abort
> > +     if (ubound (b (:, :), 2) .ne. 80) call abort
> > +
> > +     if (lbound (b (20:30:3, 40), 1) .ne. 1) call abort
> > +     if (ubound (b (20:30:3, 40), 1) .ne. 4) call abort
> > +   end subroutine test
> > + end program main
>
> This entire test case optimizes away to nothing for me with Richard
> Guenther's array aliasing patch.  You should probably add an explicit
> interface for test and not make test CONTAINED.

I plan on fixing intermodule inlining sometime, so rearranging the testcase is 
just delaying the inevitable.

Paul


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