This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Committed] PR fortran/77694
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Sun, 25 Sep 2016 10:33:01 -0700
- Subject: [Committed] PR fortran/77694
- Authentication-results: sourceware.org; auth=none
Committed as "obvious" even though thomas OK patch
in bugzilla audit trail.
2016-09-25 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77694
* frontend-passes.c (optimize_binop_array_assignment): Check pointer
for NULL.
2016-09-25 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77694
* gfortran.dg/pr77694.f90: New test.
Index: gcc/fortran/frontend-passes.c
===================================================================
--- gcc/fortran/frontend-passes.c (revision 240383)
+++ gcc/fortran/frontend-passes.c (working copy)
@@ -1076,6 +1076,9 @@ optimize_binop_array_assignment (gfc_cod
{
gfc_expr *e;
+ if (!*rhs)
+ return false;
+
e = *rhs;
if (e->expr_type == EXPR_OP)
{
Index: gcc/testsuite/gfortran.dg/pr77694.f90
===================================================================
--- gcc/testsuite/gfortran.dg/pr77694.f90 (nonexistent)
+++ gcc/testsuite/gfortran.dg/pr77694.f90 (working copy)
@@ -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
--
Steve