public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/101084] New: [10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1124
@ 2021-06-15 17:07 gscfq@t-online.de
  2021-06-15 18:47 ` [Bug fortran/101084] " anlauf at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: gscfq@t-online.de @ 2021-06-15 17:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101084

            Bug ID: 101084
           Summary: [10/11/12 Regression] ICE in gfc_typenode_for_spec, at
                    fortran/trans-types.c:1124
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Changed between 20191215 and 20200105 :


$ cat z1.f90
program p
   integer, parameter :: a(0) = 1
   print int(a)
end


$ gfortran-10-20191215 -c z1.f90
z1.f90:3:8:

    3 |    print int(a)
      |        1
Error: Constant expression in FORMAT tag at (1) must be of type default
CHARACTER


$ gfortran-12-20210613 -c z1.f90
z1.f90:3:8:

    3 |    print int(a)
      |        1
Warning: Legacy Extension: Non-character in FORMAT tag at (1)
z1.f90:3:15:

    3 |    print int(a)
      |               1
internal compiler error: in gfc_typenode_for_spec, at
fortran/trans-types.c:1124
0x822a30 gfc_typenode_for_spec(gfc_typespec*, int)
        ../../gcc/fortran/trans-types.c:1124
0x7ada4c gfc_conv_expr_descriptor(gfc_se*, gfc_expr*)
        ../../gcc/fortran/trans-array.c:7544
0x7b46cb gfc_conv_array_parameter(gfc_se*, gfc_expr*, bool, gfc_symbol const*,
char const*, tree_node**)
        ../../gcc/fortran/trans-array.c:8110
0x7fa20c gfc_convert_array_to_string
        ../../gcc/fortran/trans-io.c:788
0x7fa20c set_string
        ../../gcc/fortran/trans-io.c:848
0x7fc1be build_dt
        ../../gcc/fortran/trans-io.c:1941
0x79fb37 trans_code
        ../../gcc/fortran/trans.c:2110
0x7c6054 gfc_generate_function_code(gfc_namespace*)
        ../../gcc/fortran/trans-decl.c:6893
0x74c876 translate_all_program_units
        ../../gcc/fortran/parse.c:6461
0x74c876 gfc_parse_file()
        ../../gcc/fortran/parse.c:6730
0x798bbf gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:212

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

* [Bug fortran/101084] [10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1124
  2021-06-15 17:07 [Bug fortran/101084] New: [10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1124 gscfq@t-online.de
@ 2021-06-15 18:47 ` anlauf at gcc dot gnu.org
  2021-06-15 19:32 ` anlauf at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-06-15 18:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101084

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Target Milestone|---                         |10.4
   Last reconfirmed|                            |2021-06-15
           Priority|P3                          |P4
             Status|UNCONFIRMED                 |NEW
                 CC|                            |anlauf at gcc dot gnu.org

--- Comment #1 from anlauf at gcc dot gnu.org ---
Confirmed.

Untested fix:

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

This would give:

pr101084-z1.f90:3:8:

    3 |    print int(a)
      |        1
Error: Non-character non-Hollerith in FORMAT tag at (1)

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

* [Bug fortran/101084] [10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1124
  2021-06-15 17:07 [Bug fortran/101084] New: [10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1124 gscfq@t-online.de
  2021-06-15 18:47 ` [Bug fortran/101084] " anlauf at gcc dot gnu.org
@ 2021-06-15 19:32 ` anlauf at gcc dot gnu.org
  2021-07-18 19:36 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-06-15 19:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101084

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |anlauf at gcc dot gnu.org

--- Comment #2 from anlauf at gcc dot gnu.org ---
Regtests ok.

Submitted: https://gcc.gnu.org/pipermail/fortran/2021-June/056166.html

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

* [Bug fortran/101084] [10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1124
  2021-06-15 17:07 [Bug fortran/101084] New: [10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1124 gscfq@t-online.de
  2021-06-15 18:47 ` [Bug fortran/101084] " anlauf at gcc dot gnu.org
  2021-06-15 19:32 ` anlauf at gcc dot gnu.org
@ 2021-07-18 19:36 ` cvs-commit at gcc dot gnu.org
  2021-07-28 18:18 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-18 19:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101084

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Harald Anlauf <anlauf@gcc.gnu.org>:

https://gcc.gnu.org/g:f527b8233498b40c8a2c616b82265f2e58aba42a

commit r12-2386-gf527b8233498b40c8a2c616b82265f2e58aba42a
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Sun Jul 18 21:35:53 2021 +0200

    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] 7+ messages in thread

* [Bug fortran/101084] [10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1124
  2021-06-15 17:07 [Bug fortran/101084] New: [10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1124 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2021-07-18 19:36 ` cvs-commit at gcc dot gnu.org
@ 2021-07-28 18:18 ` cvs-commit at gcc dot gnu.org
  2021-07-28 19:09 ` cvs-commit at gcc dot gnu.org
  2021-07-28 19:11 ` anlauf at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-28 18:18 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101084

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:

https://gcc.gnu.org/g:0b506dcf9f9c41d94ccb6c2839884d029378ec0a

commit r11-8811-g0b506dcf9f9c41d94ccb6c2839884d029378ec0a
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Sun Jul 18 21:35:53 2021 +0200

    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.

    (cherry picked from commit f527b8233498b40c8a2c616b82265f2e58aba42a)

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

* [Bug fortran/101084] [10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1124
  2021-06-15 17:07 [Bug fortran/101084] New: [10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1124 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2021-07-28 18:18 ` cvs-commit at gcc dot gnu.org
@ 2021-07-28 19:09 ` cvs-commit at gcc dot gnu.org
  2021-07-28 19:11 ` anlauf at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-28 19:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101084

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:

https://gcc.gnu.org/g:7277ac60e0def3fe6bf76fee239701dbaf3d4e0e

commit r10-10010-g7277ac60e0def3fe6bf76fee239701dbaf3d4e0e
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Sun Jul 18 21:35:53 2021 +0200

    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.

    (cherry picked from commit f527b8233498b40c8a2c616b82265f2e58aba42a)

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

* [Bug fortran/101084] [10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1124
  2021-06-15 17:07 [Bug fortran/101084] New: [10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1124 gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2021-07-28 19:09 ` cvs-commit at gcc dot gnu.org
@ 2021-07-28 19:11 ` anlauf at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-07-28 19:11 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101084

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #6 from anlauf at gcc dot gnu.org ---
Fixed on all affected branches.  Closing.

Thanks for the report!

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

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

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-15 17:07 [Bug fortran/101084] New: [10/11/12 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1124 gscfq@t-online.de
2021-06-15 18:47 ` [Bug fortran/101084] " anlauf at gcc dot gnu.org
2021-06-15 19:32 ` anlauf at gcc dot gnu.org
2021-07-18 19:36 ` cvs-commit at gcc dot gnu.org
2021-07-28 18:18 ` cvs-commit at gcc dot gnu.org
2021-07-28 19:09 ` cvs-commit at gcc dot gnu.org
2021-07-28 19:11 ` anlauf at gcc dot gnu.org

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