public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r10-6692] [Fortran] ICE in gfc_typenode_for_spec PR93603
@ 2020-02-18 12:24 Mark Eggleston
0 siblings, 0 replies; only message in thread
From: Mark Eggleston @ 2020-02-18 12:24 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:8f55a0eec910dd02992f4caca083048d91c0b2e1
commit r10-6692-g8f55a0eec910dd02992f4caca083048d91c0b2e1
Author: Mark Eggleston <markeggleston@gcc.gnu.org>
Date: Tue Feb 18 12:23:20 2020 +0000
[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.
Diff:
---
gcc/fortran/ChangeLog | 7 +++++++
gcc/fortran/match.c | 8 ++++++++
gcc/testsuite/ChangeLog | 5 +++++
gcc/testsuite/gfortran.dg/pr93603.f90 | 7 +++++++
4 files changed, 27 insertions(+)
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 302af3a..2e874b8 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,4 +1,11 @@
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
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index a74cb8c..9c2ec41 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -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. */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 1c7f879..f9a545e 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+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
diff --git a/gcc/testsuite/gfortran.dg/pr93603.f90 b/gcc/testsuite/gfortran.dg/pr93603.f90
new file mode 100644
index 0000000..fd452e5
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr93603.f90
@@ -0,0 +1,7 @@
+! { 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
+
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-02-18 12:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-18 12:24 [gcc r10-6692] [Fortran] ICE in gfc_typenode_for_spec PR93603 Mark Eggleston
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).