This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, fortran] PR29758 - Runtime segfault in RESHAPE with insufficient elements in SOURCE
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: Paul Thomas <paulthomas2 at wanadoo dot fr>
- Cc: Fortran List <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 10 Nov 2006 10:54:46 -0800
- Subject: Re: [Patch, fortran] PR29758 - Runtime segfault in RESHAPE with insufficient elements in SOURCE
- References: <45526A37.5030907@wanadoo.fr> <4554C1AC.1060903@wanadoo.fr>
On Fri, Nov 10, 2006 at 07:15:08PM +0100, Paul Thomas wrote:
> >
> >Index: gcc/testsuite/gfortran.dg/reshape_source_size_1.f90
> >===================================================================
> >*** gcc/testsuite/gfortran.dg/reshape_source_size_1.f90 (revision 0)
> >--- gcc/testsuite/gfortran.dg/reshape_source_size_1.f90 (revision 0)
> >***************
> >*** 0 ****
> >--- 1,11 ----
> >+ ! { dg-do compile }
> >+ ! Tests patch for PR29758, which arose from PR29431. There was no check
> >that there
> >+ ! were enough elements in the source to match the shape.
> >+ !
> >+ ! Contributed by Paul Thomas <pault@gcc.gnu.org>
> >+ !
> >+ real :: a(2,2), b = 1.0, c(3), d(4)
> >+ a = reshape ([b], [2,2]) ! { dg-error "not enough elements" }
> >+ a = reshape (c, [2,2]) ! { dg-error "not enough elements" }
> >+ a = reshape (d, [2,2])
> >+ end
Do we silently accept the [,] array notation? If not, you'll
need to change this to (/ /).
Otherwise, OK.
--
Steve