This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: PR fortran/18899: ubound() failing for assumed-shape arrays
- From: Paul Brook <paul at codesourcery dot com>
- To: fortran at gcc dot gnu dot org
- Cc: Steven Bosscher <stevenb at suse dot de>,Richard Sandiford <richard at codesourcery dot com>,gcc-patches at gcc dot gnu dot org
- Date: Mon, 12 Sep 2005 13:56:35 +0100
- Subject: Re: PR fortran/18899: ubound() failing for assumed-shape arrays
- Organization: CodeSourcery
- References: <87zmqiehza.fsf@talisman.home> <200509121208.38635.stevenb@suse.de>
> > + 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