Associating a symbol with a BOZ constant caused an ICE. Output
an error message as an association target cannot be a BOZ
constant.
Original patch provided by Steven G. Kargl <kargl@gcc.gnu.org>.
gcc/fortran/ChangeLog
PR fortran/93603
* match.c (gfc_match_associate) : If target expression
has the type BT_BOZ output an error and goto
assocListError.
gcc/testsuite/ChangeLog
PR fortran/93603
* gfortran.dg/pr93603.f90 : New test.
+2020-02-18 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/93603
+ * match.c (gfc_match_associate) : If target expression
+ has the type BT_BOZ output an error and goto
+ assocListError.
+
2020-02-18 Steven G. Kargl <kargl@gcc.gnu.org>
Mark Eggleston <markeggleston@gcc.gnu.org>
goto assocListError;
}
+ /* The target expression cannot be a BOZ literal constant. */
+ if (newAssoc->target->ts.type == BT_BOZ)
+ {
+ gfc_error ("Association target at %L cannot be a BOZ literal "
+ "constant", &newAssoc->target->where);
+ goto assocListError;
+ }
+
/* The `variable' field is left blank for now; because the target is not
yet resolved, we can't use gfc_has_vector_subscript to determine it
for now. This is set during resolution. */
+2020-02-18 Mark Eggleston <mark.eggleston@codethink.com>
+
+ PR fortran/93603
+ * gfortran.dg/pr93603.f90 : New test.
+
2020-02-20 Mark Eggleston <markeggleston@gcc.gnu.org>
PR fortran/93580
--- /dev/null
+! { dg-do compile }
+
+program p
+ associate (y => z'1') ! { dg-error "cannot be a BOZ literal constant" }
+ end associate ! { dg-error "Expecting END PROGRAM" }
+end
+