Commit 8f55a0ee by Mark Eggleston

[Fortran] ICE in gfc_typenode_for_spec PR93603

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.
parent d4c10c9f
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>
PR fortran/93580
......
......@@ -1957,6 +1957,14 @@ gfc_match_associate (void)
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
......
! { 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment