public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] PR fortran/101084 - [10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1124
@ 2021-06-15 19:31 Harald Anlauf
  2021-07-12 19:29 ` *Ping* " Harald Anlauf
  0 siblings, 1 reply; 2+ messages in thread
From: Harald Anlauf @ 2021-06-15 19:31 UTC (permalink / raw)
  To: fortran, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 456 bytes --]

A recent change to the checking of legacy FORMAT tags did not handle
cases where the type is not set.  Adjust the check.

Regtested on x86_64-pc-linux-gnu.

OK for mainline / 11- / 10-branch?

Thanks,
Harald


Fortran: reject FORMAT tag of unknown type.

gcc/fortran/ChangeLog:

	PR fortran/101084
	* io.c (resolve_tag_format): Extend FORMAT check to unknown type.

gcc/testsuite/ChangeLog:

	PR fortran/101084
	* gfortran.dg/fmt_nonchar_3.f90: New test.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: pr101084.patch --]
[-- Type: text/x-patch, Size: 874 bytes --]

diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c
index 40cd76eb585..fc97df79eca 100644
--- a/gcc/fortran/io.c
+++ b/gcc/fortran/io.c
@@ -1763,7 +1763,7 @@ resolve_tag_format (gfc_expr *e)
   if (e->ts.type != BT_CHARACTER)
     {
       if (e->ts.type == BT_DERIVED || e->ts.type == BT_CLASS
-	  || e->ts.type == BT_VOID)
+	  || e->ts.type == BT_VOID || e->ts.type == BT_UNKNOWN)
 	{
 	  gfc_error ("Non-character non-Hollerith in FORMAT tag at %L",
 		     &e->where);
diff --git a/gcc/testsuite/gfortran.dg/fmt_nonchar_3.f90 b/gcc/testsuite/gfortran.dg/fmt_nonchar_3.f90
new file mode 100644
index 00000000000..3b3c260ef7f
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/fmt_nonchar_3.f90
@@ -0,0 +1,7 @@
+! { dg-do compile }
+! PR fortran/101084
+
+program p
+  integer, parameter :: a(0) = 1
+  print int(a) ! { dg-error "Non-character non-Hollerith in FORMAT tag" }
+end

^ permalink raw reply	[flat|nested] 2+ messages in thread

* *Ping* [PATCH] PR fortran/101084 - [10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1124
  2021-06-15 19:31 [PATCH] PR fortran/101084 - [10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1124 Harald Anlauf
@ 2021-07-12 19:29 ` Harald Anlauf
  0 siblings, 0 replies; 2+ messages in thread
From: Harald Anlauf @ 2021-07-12 19:29 UTC (permalink / raw)
  To: Harald Anlauf; +Cc: fortran, gcc-patches

*Ping*

> Gesendet: Dienstag, 15. Juni 2021 um 21:31 Uhr
> Von: "Harald Anlauf" <anlauf@gmx.de>
> An: "fortran" <fortran@gcc.gnu.org>, "gcc-patches" <gcc-patches@gcc.gnu.org>
> Betreff: [PATCH] PR fortran/101084 - [10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1124
>
> A recent change to the checking of legacy FORMAT tags did not handle
> cases where the type is not set.  Adjust the check.
>
> Regtested on x86_64-pc-linux-gnu.
>
> OK for mainline / 11- / 10-branch?
>
> Thanks,
> Harald
>
>
> Fortran: reject FORMAT tag of unknown type.
>
> gcc/fortran/ChangeLog:
>
> 	PR fortran/101084
> 	* io.c (resolve_tag_format): Extend FORMAT check to unknown type.
>
> gcc/testsuite/ChangeLog:
>
> 	PR fortran/101084
> 	* gfortran.dg/fmt_nonchar_3.f90: New test.
>
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-12 19:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-15 19:31 [PATCH] PR fortran/101084 - [10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1124 Harald Anlauf
2021-07-12 19:29 ` *Ping* " Harald Anlauf

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).