From: Steven G. Kargl Date: Thu, 1 Dec 2016 20:37:55 +0000 (+0000) Subject: re PR fortran/78279 (ICE in identical_array_ref, at fortran/dependency.c:104) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=96ad5df6db65383330cba79ed823a0256e750033;p=gcc.git re PR fortran/78279 (ICE in identical_array_ref, at fortran/dependency.c:104) 2016-12-01 Steven G. Kargl PR fortran/78279 * dependency.c (identical_array_ref): Convert gcc_assert to conditional and gfc_internal_error. 2016-12-01 Steven G. Kargl PR fortran/78279 * gfortran.dg/pr78279.f90: New test. From-SVN: r243131 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 278c08f0c89..d4103927100 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2016-12-01 Steven G. Kargl + + PR fortran/78279 + * dependency.c (identical_array_ref): Convert gcc_assert to conditional + and gfc_internal_error. + 2016-11-30 Andre Vehreschild * check.c (gfc_check_allocated): By pass the caf_get call and check on diff --git a/gcc/fortran/dependency.c b/gcc/fortran/dependency.c index 82c5e6b5733..4a3c1a793c1 100644 --- a/gcc/fortran/dependency.c +++ b/gcc/fortran/dependency.c @@ -101,7 +101,9 @@ identical_array_ref (gfc_array_ref *a1, gfc_array_ref *a2) if (a1->type == AR_ELEMENT && a2->type == AR_ELEMENT) { - gcc_assert (a1->dimen == a2->dimen); + if (a1->dimen != a2->dimen) + gfc_internal_error ("identical_array_ref(): inconsistent dimensions"); + for (i = 0; i < a1->dimen; i++) { if (gfc_dep_compare_expr (a1->start[i], a2->start[i]) != 0) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d6e5ac47881..321a48a8eab 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-12-01 Steven G. Kargl + + PR fortran/78279 + * gfortran.dg/pr78279.f90: New test. + 2016-12-01 David Edelsohn * g++.dg/tls/pr77285-1.C: dg-add-options tls diff --git a/gcc/testsuite/gfortran.dg/pr78279.f90 b/gcc/testsuite/gfortran.dg/pr78279.f90 new file mode 100644 index 00000000000..cb0175295a1 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr78279.f90 @@ -0,0 +1,10 @@ +! { dg-do compile } +! { dg-options "-Ofast" } +program p + integer :: i + real :: z(2,4) + z = 0.0 + do i = 1, 3 + if ( z(i) > z(1,i+1) ) print *, i ! { dg-error "mismatch in array reference" } + end do +end