public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/102311] New: [11/12 Regression] ICE in gfc_enforce_clean_symbol_state, at fortran/symbol.c:4278
@ 2021-09-13 17:26 gscfq@t-online.de
  2021-09-13 18:54 ` [Bug fortran/102311] " anlauf at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: gscfq@t-online.de @ 2021-09-13 17:26 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102311
           Summary: [11/12 Regression] ICE in
                    gfc_enforce_clean_symbol_state, at
                    fortran/symbol.c:4278
           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 20210822 and 20210905 :
(gcc configured with --enable-checking=yes)


$ cat z1.f90
module m
contains
   function f()
      character(:), allocatable :: f
      character(1) :: g
   entry g()
   end
end


$ cat z2.f90
module m
contains
   function f()
      character(:), allocatable :: f
      character(1) :: g
      f = 'f'
   entry g()
      g = 'g'
   end
end


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

    8 | end
      |   1
Error: Entity 'master.0.f' at (1) has a deferred type parameter and requires
either the POINTER or ALLOCATABLE attribute


$ gfortran-12-20210905 -c z1.f90
z1.f90:3:3:

    3 |    function f()
      |   1
Error: Function f at (1) has entry g with mismatched characteristics
z1.f90:3:3:

    3 |    function f()
      |   1
Error: Function f at (1) has entry g with mismatched characteristics
f951: internal compiler error: in gfc_enforce_clean_symbol_state, at
fortran/symbol.c:4278
0x8422f0 gfc_enforce_clean_symbol_state()
        ../../gcc/fortran/symbol.c:4278
0x7fd9bc next_statement
        ../../gcc/fortran/parse.c:1589
0x8034e4 gfc_parse_file()
        ../../gcc/fortran/parse.c:6638
0x8510ff gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:216

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

* [Bug fortran/102311] [11/12 Regression] ICE in gfc_enforce_clean_symbol_state, at fortran/symbol.c:4278
  2021-09-13 17:26 [Bug fortran/102311] New: [11/12 Regression] ICE in gfc_enforce_clean_symbol_state, at fortran/symbol.c:4278 gscfq@t-online.de
@ 2021-09-13 18:54 ` anlauf at gcc dot gnu.org
  2021-09-13 19:13 ` anlauf at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-09-13 18:54 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-09-13
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

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

(gdb) l symbol.c:4278
4273
4274    void
4275    gfc_enforce_clean_symbol_state(void)
4276    {
4277      enforce_single_undo_checkpoint ();
4278      gcc_assert (latest_undo_chgset->syms.is_empty ());
4279    }

For some reason we fail to clean up when the function is contained in a module.

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

* [Bug fortran/102311] [11/12 Regression] ICE in gfc_enforce_clean_symbol_state, at fortran/symbol.c:4278
  2021-09-13 17:26 [Bug fortran/102311] New: [11/12 Regression] ICE in gfc_enforce_clean_symbol_state, at fortran/symbol.c:4278 gscfq@t-online.de
  2021-09-13 18:54 ` [Bug fortran/102311] " anlauf at gcc dot gnu.org
@ 2021-09-13 19:13 ` anlauf at gcc dot gnu.org
  2021-09-14  6:55 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-09-13 19:13 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anlauf at gcc dot gnu.org

--- Comment #2 from anlauf at gcc dot gnu.org ---
Potential fix:

diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 8e5ed1c032c..30b96b2f597 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -811,7 +811,7 @@ resolve_entries (gfc_namespace *ns)
              gfc_error ("Function %s at %L has entry %s with mismatched "
                         "characteristics", ns->entries->sym->name,
                         &ns->entries->sym->declared_at, el->sym->name);
-             return;
+             goto cleanup;
            }
          else if (ts->type == BT_CHARACTER && ts->u.cl && fts->u.cl
                   && (((ts->u.cl->length && !fts->u.cl->length)
@@ -917,6 +917,8 @@ resolve_entries (gfc_namespace *ns)
            }
        }
     }
+
+cleanup:
   proc->attr.access = ACCESS_PRIVATE;
   proc->attr.entry_master = 1;

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

* [Bug fortran/102311] [11/12 Regression] ICE in gfc_enforce_clean_symbol_state, at fortran/symbol.c:4278
  2021-09-13 17:26 [Bug fortran/102311] New: [11/12 Regression] ICE in gfc_enforce_clean_symbol_state, at fortran/symbol.c:4278 gscfq@t-online.de
  2021-09-13 18:54 ` [Bug fortran/102311] " anlauf at gcc dot gnu.org
  2021-09-13 19:13 ` anlauf at gcc dot gnu.org
@ 2021-09-14  6:55 ` rguenth at gcc dot gnu.org
  2021-09-14  7:21 ` marxin at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-09-14  6:55 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.3
           Priority|P3                          |P4

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

* [Bug fortran/102311] [11/12 Regression] ICE in gfc_enforce_clean_symbol_state, at fortran/symbol.c:4278
  2021-09-13 17:26 [Bug fortran/102311] New: [11/12 Regression] ICE in gfc_enforce_clean_symbol_state, at fortran/symbol.c:4278 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2021-09-14  6:55 ` rguenth at gcc dot gnu.org
@ 2021-09-14  7:21 ` marxin at gcc dot gnu.org
  2021-09-14  7:40 ` anlauf at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-09-14  7:21 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marxin at gcc dot gnu.org

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
Likely started with r12-3201-gf9809ef57005409e.

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

* [Bug fortran/102311] [11/12 Regression] ICE in gfc_enforce_clean_symbol_state, at fortran/symbol.c:4278
  2021-09-13 17:26 [Bug fortran/102311] New: [11/12 Regression] ICE in gfc_enforce_clean_symbol_state, at fortran/symbol.c:4278 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2021-09-14  7:21 ` marxin at gcc dot gnu.org
@ 2021-09-14  7:40 ` anlauf at gcc dot gnu.org
  2021-09-14 18:23 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-09-14  7:40 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

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

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

* [Bug fortran/102311] [11/12 Regression] ICE in gfc_enforce_clean_symbol_state, at fortran/symbol.c:4278
  2021-09-13 17:26 [Bug fortran/102311] New: [11/12 Regression] ICE in gfc_enforce_clean_symbol_state, at fortran/symbol.c:4278 gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2021-09-14  7:40 ` anlauf at gcc dot gnu.org
@ 2021-09-14 18:23 ` cvs-commit at gcc dot gnu.org
  2021-09-14 18:55 ` anlauf at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-09-14 18:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 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:b305ec979d9dfc8153859a62a8ab9dd43c3bfc73

commit r12-3533-gb305ec979d9dfc8153859a62a8ab9dd43c3bfc73
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Tue Sep 14 20:23:27 2021 +0200

    Fortran - fix ICE during error recovery checking entry characteristics

    gcc/fortran/ChangeLog:

            PR fortran/102311
            * resolve.c (resolve_entries): Attempt to recover cleanly after
            rejecting mismatched function entries.

    gcc/testsuite/ChangeLog:

            PR fortran/102311
            * gfortran.dg/entry_25.f90: New test.

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

* [Bug fortran/102311] [11/12 Regression] ICE in gfc_enforce_clean_symbol_state, at fortran/symbol.c:4278
  2021-09-13 17:26 [Bug fortran/102311] New: [11/12 Regression] ICE in gfc_enforce_clean_symbol_state, at fortran/symbol.c:4278 gscfq@t-online.de
                   ` (5 preceding siblings ...)
  2021-09-14 18:23 ` cvs-commit at gcc dot gnu.org
@ 2021-09-14 18:55 ` anlauf at gcc dot gnu.org
  2021-09-19 19:19 ` cvs-commit at gcc dot gnu.org
  2021-09-19 19:28 ` anlauf at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-09-14 18:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from anlauf at gcc dot gnu.org ---
For the sake of completeness: considered as "obvious"

https://gcc.gnu.org/pipermail/fortran/2021-September/056521.html

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

* [Bug fortran/102311] [11/12 Regression] ICE in gfc_enforce_clean_symbol_state, at fortran/symbol.c:4278
  2021-09-13 17:26 [Bug fortran/102311] New: [11/12 Regression] ICE in gfc_enforce_clean_symbol_state, at fortran/symbol.c:4278 gscfq@t-online.de
                   ` (6 preceding siblings ...)
  2021-09-14 18:55 ` anlauf at gcc dot gnu.org
@ 2021-09-19 19:19 ` cvs-commit at gcc dot gnu.org
  2021-09-19 19:28 ` anlauf at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-09-19 19:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 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:1ae01a88d35a0e2b7d7686fcb3a4fdcc2a04e9f4

commit r11-9014-g1ae01a88d35a0e2b7d7686fcb3a4fdcc2a04e9f4
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Tue Sep 14 20:23:27 2021 +0200

    Fortran - fix ICE during error recovery checking entry characteristics

    gcc/fortran/ChangeLog:

            PR fortran/102311
            * resolve.c (resolve_entries): Attempt to recover cleanly after
            rejecting mismatched function entries.

    gcc/testsuite/ChangeLog:

            PR fortran/102311
            * gfortran.dg/entry_25.f90: New test.

    (cherry picked from commit b305ec979d9dfc8153859a62a8ab9dd43c3bfc73)

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

* [Bug fortran/102311] [11/12 Regression] ICE in gfc_enforce_clean_symbol_state, at fortran/symbol.c:4278
  2021-09-13 17:26 [Bug fortran/102311] New: [11/12 Regression] ICE in gfc_enforce_clean_symbol_state, at fortran/symbol.c:4278 gscfq@t-online.de
                   ` (7 preceding siblings ...)
  2021-09-19 19:19 ` cvs-commit at gcc dot gnu.org
@ 2021-09-19 19:28 ` anlauf at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-09-19 19:28 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

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

--- Comment #7 from anlauf at gcc dot gnu.org ---
Should be fixed on affected branches.  Closing.

Thanks for the report!

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

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

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-13 17:26 [Bug fortran/102311] New: [11/12 Regression] ICE in gfc_enforce_clean_symbol_state, at fortran/symbol.c:4278 gscfq@t-online.de
2021-09-13 18:54 ` [Bug fortran/102311] " anlauf at gcc dot gnu.org
2021-09-13 19:13 ` anlauf at gcc dot gnu.org
2021-09-14  6:55 ` rguenth at gcc dot gnu.org
2021-09-14  7:21 ` marxin at gcc dot gnu.org
2021-09-14  7:40 ` anlauf at gcc dot gnu.org
2021-09-14 18:23 ` cvs-commit at gcc dot gnu.org
2021-09-14 18:55 ` anlauf at gcc dot gnu.org
2021-09-19 19:19 ` cvs-commit at gcc dot gnu.org
2021-09-19 19:28 ` 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).