From 9b597c1f414566f7bebed6bd88675a8c022a07e2 Mon Sep 17 00:00:00 2001 From: "Steven G. Kargl" Date: Sun, 25 Sep 2016 18:46:28 +0000 Subject: [PATCH] re PR fortran/77429 (ICE in gfc_check_dependency, at fortran/dependency.c:1261) 2016-09-25 Steven G. Kargl PR fortran/77429 * dependency.c (gfc_check_dependency): Convert gcc_assert() to a conditional and possible call to gfc_internal_error(). 2016-09-25 Steven G. Kargl PR fortran/77429 * gfortran.dg/pr77429.f90: New test. From-SVN: r240477 --- gcc/fortran/ChangeLog | 6 ++++++ gcc/fortran/dependency.c | 3 ++- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/pr77429.f90 | 7 +++++++ 4 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gfortran.dg/pr77429.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 96867e386d6..5675e03039e 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2016-09-25 Steven G. Kargl + + PR fortran/77429 + * dependency.c (gfc_check_dependency): Convert gcc_assert() to + a conditional and possible call to gfc_internal_error(). + 2016-09-25 Steven G. Kargl PR fortran/77694 diff --git a/gcc/fortran/dependency.c b/gcc/fortran/dependency.c index 58a443be09a..12e5d133151 100644 --- a/gcc/fortran/dependency.c +++ b/gcc/fortran/dependency.c @@ -1258,7 +1258,8 @@ gfc_check_dependency (gfc_expr *expr1, gfc_expr *expr2, bool identical) && strcmp (expr1->value.function.name, "_F.caf_get") == 0) return 0; - gcc_assert (expr1->expr_type == EXPR_VARIABLE); + if (expr1->expr_type != EXPR_VARIABLE) + gfc_internal_error ("gfc_check_dependency: expecting an EXPR_VARIABLE"); switch (expr2->expr_type) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5f7435ee897..45e5307f679 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-09-25 Steven G. Kargl + + PR fortran/77429 + * gfortran.dg/pr77429.f90: New test. + 2016-09-25 Steven G. Kargl PR fortran/77694 diff --git a/gcc/testsuite/gfortran.dg/pr77429.f90 b/gcc/testsuite/gfortran.dg/pr77429.f90 new file mode 100644 index 00000000000..0f9023794d7 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr77429.f90 @@ -0,0 +1,7 @@ +! { dg-do compile } +program p + shape(1) = 0 ! { dg-error "expression in variable definition context" } + shape(1,2) = 0 ! { dg-error "expression in variable definition context" } + shape(1,2,3) = 0 ! { dg-error "Too many arguments in call" } + lbound([1]) = 0 ! { dg-error "expression in variable definition context" } +end -- 2.30.2