mirror of git://gcc.gnu.org/git/gcc.git
re PR fortran/50130 (ICE with invalid array slice)
2011-08-21 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/50130 * resolve.c (resolve_array_ref): Don't calculate upper bound if the stride is zero. 2011-08-21 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/50130 * gfortran.dg/zero_stride_1.f90: New test. From-SVN: r177940
This commit is contained in:
parent
5193535841
commit
2d27cb4477
|
@ -1,3 +1,9 @@
|
|||
2011-08-21 Thomas Koenig <tkoenig@gcc.gnu.org>
|
||||
|
||||
PR fortran/50130
|
||||
* resolve.c (resolve_array_ref): Don't calculate upper bound
|
||||
if the stride is zero.
|
||||
|
||||
2011-08-20 Janus Weil <janus@gcc.gnu.org>
|
||||
|
||||
PR fortran/49638
|
||||
|
|
|
@ -4569,10 +4569,11 @@ resolve_array_ref (gfc_array_ref *ar)
|
|||
/* Fill in the upper bound, which may be lower than the
|
||||
specified one for something like a(2:10:5), which is
|
||||
identical to a(2:7:5). Only relevant for strides not equal
|
||||
to one. */
|
||||
to one. Don't try a division by zero. */
|
||||
if (ar->dimen_type[i] == DIMEN_RANGE
|
||||
&& ar->stride[i] != NULL && ar->stride[i]->expr_type == EXPR_CONSTANT
|
||||
&& mpz_cmp_si (ar->stride[i]->value.integer, 1L) != 0)
|
||||
&& mpz_cmp_si (ar->stride[i]->value.integer, 1L) != 0
|
||||
&& mpz_cmp_si (ar->stride[i]->value.integer, 0L) != 0)
|
||||
{
|
||||
mpz_t size, end;
|
||||
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2011-08-21 Thomas Koenig <tkoenig@gcc.gnu.org>
|
||||
|
||||
PR fortran/50130
|
||||
* gfortran.dg/zero_stride_1.f90: New test.
|
||||
|
||||
2011-08-20 Janus Weil <janus@gcc.gnu.org>
|
||||
|
||||
PR fortran/49638
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
! { dg-do compile }
|
||||
! PR 50130 - this caused an ICE. Test case supplied by Joost
|
||||
! VandeVondele.
|
||||
integer, parameter :: a(10)=0
|
||||
integer, parameter :: b(10)=a(1:10:0) ! { dg-error "Illegal stride of zero" }
|
||||
END
|
||||
|
Loading…
Reference in New Issue