From f1c7e7f10fe8b4ad6dbfb2a93c850d52693a6331 Mon Sep 17 00:00:00 2001 From: "Steven G. Kargl" Date: Sun, 25 Sep 2016 17:30:27 +0000 Subject: [PATCH] re PR fortran/77694 (ICE in optimize_binop_array_assignment, at fortran/frontend-passes.c:1080) 2016-09-22 Steven G. Kargl PR fortran/77694 * frontend-passes.c (optimize_binop_array_assignment): Check pointer for NULL. 2016-09-22 Steven G. Kargl PR fortran/77694 * gfortran.dg/pr77694.f90: New test. From-SVN: r240476 --- gcc/fortran/ChangeLog | 6 ++++++ gcc/fortran/frontend-passes.c | 3 +++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/pr77694.f90 | 7 +++++++ 4 files changed, 21 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/pr77694.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index fbab438a959..96867e386d6 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2016-09-25 Steven G. Kargl + + PR fortran/77694 + * frontend-passes.c (optimize_binop_array_assignment): Check pointer + for NULL. + 2016-09-23 Fritz Reese * lang.opt, invoke.texi, gfortran.texi: New flag -fdec-static. diff --git a/gcc/fortran/frontend-passes.c b/gcc/fortran/frontend-passes.c index cd109791075..3a2c16e5226 100644 --- a/gcc/fortran/frontend-passes.c +++ b/gcc/fortran/frontend-passes.c @@ -1076,6 +1076,9 @@ optimize_binop_array_assignment (gfc_code *c, gfc_expr **rhs, bool seen_op) { gfc_expr *e; + if (!*rhs) + return false; + e = *rhs; if (e->expr_type == EXPR_OP) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4fc22c4e65f..5f7435ee897 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-09-25 Steven G. Kargl + + PR fortran/77694 + * gfortran.dg/pr77694.f90: New test. + 2016-09-25 Oleg Endo PR target/51244 diff --git a/gcc/testsuite/gfortran.dg/pr77694.f90 b/gcc/testsuite/gfortran.dg/pr77694.f90 new file mode 100644 index 00000000000..d9dc01b903a --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr77694.f90 @@ -0,0 +1,7 @@ +! { dg-do compile } +! { dg-options -O } +program p + logical x(2), y(2) + x = .true. + y = .nt. x ! { dg-error "Unknown operator" } +end -- 2.30.2