This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/36874] Add shape checks to cshift/eoshift
- From: "dfranke at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Jan 2009 18:39:29 -0000
- Subject: [Bug fortran/36874] Add shape checks to cshift/eoshift
- References: <bug-36874-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from dfranke at gcc dot gnu dot org 2009-01-24 18:39 -------
After adding the the missing checks to gfc_check_cshift() and
gfc_check_eoshift() respectively, I get a couple of errors for
gfortran.dg/zero_sized_1.f90:
$> gfortran-svn -g -Wall -W zero_sized_1.f90
zero_sized_1.f90:18.36:
if (any(cshift(tempm(5:4,:),shift=(/1,-1/),dim=2)/= 0)) call abort
1
Error: 'shift' argument of 'cshift' intrinsic at (1) has invalid shape in
dimension 1 (0/2)
[... snipped more ...]
zero_sized_1.f90:37.37:
if (any(eoshift(tempm(5:4,:),shift=(/1,-1/),dim=2)/= 0)) call abort
1
Error: 'shift' argument of 'eoshift' intrinsic at (1) has invalid shape in
dimension 1 (0/2)
[... snipped more ...]
In comparison, Intel-10.1 accepts it as is while Lahey rejects it with similar
(but less detailed) error messages.
Are runtime checks required to check the shape of the other arguments if ARRAY
is zero-sized?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36874