public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/107923] New: ICE in lookup_function_fuzzy_find_candidates / check_interface0
@ 2022-11-29 17:57 gscfq@t-online.de
  2022-11-29 17:57 ` [Bug fortran/107923] " gscfq@t-online.de
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: gscfq@t-online.de @ 2022-11-29 17:57 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107923
           Summary: ICE in lookup_function_fuzzy_find_candidates /
                    check_interface0
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Some older versions/snapshots show an ICE, some don't :


$ cat z1.f90
program p
   interface s
      module procedure a, b, a
   end interface
   call s
end


$ cat z2.f90
program p
   interface s
      module procedure a, b, a
   end interface
end


$ cat z3.f90
program p
   interface operator (.op.)
      procedure a b
   end interface
contains
end


$ cat z4.f90
module m
   interface s
      procedure a b
   end interface
end


$ gfortran-13-20221127 -c z1.f90
z1.f90:3:30:

    3 |       module procedure a, b, a
      |                              1
Error: Entity 'a' at (1) is already present in the interface
f951: internal compiler error: Segmentation fault
0xf36d0f crash_signal
        ../../gcc/toplev.cc:314
0x86e2fd lookup_function_fuzzy_find_candidates
        ../../gcc/fortran/resolve.cc:2943
0x86e328 lookup_function_fuzzy_find_candidates
        ../../gcc/fortran/resolve.cc:2949
0x872d88 gfc_lookup_function_fuzzy(char const*, gfc_symtree*)
        ../../gcc/fortran/resolve.cc:2964
0x80ad0e check_interface0
        ../../gcc/fortran/interface.cc:1885
0x80e913 check_sym_interfaces
        ../../gcc/fortran/interface.cc:2021
0x89ee32 do_traverse_symtree
        ../../gcc/fortran/symbol.cc:4180
0x80ea20 gfc_check_interfaces(gfc_namespace*)
        ../../gcc/fortran/interface.cc:2132
0x88318d resolve_types
        ../../gcc/fortran/resolve.cc:17562
0x87e4bc gfc_resolve(gfc_namespace*)
        ../../gcc/fortran/resolve.cc:17661
0x866294 resolve_all_program_units
        ../../gcc/fortran/parse.cc:6631
0x866294 gfc_parse_file()
        ../../gcc/fortran/parse.cc:6887
0x8b4d3f gfc_be_parse_file
        ../../gcc/fortran/f95-lang.cc:229

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

* [Bug fortran/107923] ICE in lookup_function_fuzzy_find_candidates / check_interface0
  2022-11-29 17:57 [Bug fortran/107923] New: ICE in lookup_function_fuzzy_find_candidates / check_interface0 gscfq@t-online.de
@ 2022-11-29 17:57 ` gscfq@t-online.de
  2022-11-30 12:42 ` marxin at gcc dot gnu.org
  2023-08-30 19:38 ` mikael at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: gscfq@t-online.de @ 2022-11-29 17:57 UTC (permalink / raw)
  To: gcc-bugs

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

G. Steinmetz <gscfq@t-online.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code

--- Comment #1 from G. Steinmetz <gscfq@t-online.de> ---

A better elaborated test case :

$ cat zz1.f90
module m
   interface s
      module procedure a, b, a
   end interface
contains
   subroutine a(x)
      integer :: x
   end
   subroutine b(x)
      real :: x
   end
end


$ gfortran-13-20221127 -c zz1.f90    # if necessary with -g or -O2
zz1.f90:3:30:

    3 |       module procedure a, b, a
      |                              1
Error: Entity 'a' at (1) is already present in the interface
f951: internal compiler error: Segmentation fault
0xf36d0f crash_signal
        ../../gcc/toplev.cc:314
0x80ad07 check_interface0
        ../../gcc/fortran/interface.cc:1885
0x80e913 check_sym_interfaces
        ../../gcc/fortran/interface.cc:2021
0x89ee32 do_traverse_symtree
        ../../gcc/fortran/symbol.cc:4180
0x80ea20 gfc_check_interfaces(gfc_namespace*)
        ../../gcc/fortran/interface.cc:2132
0x88318d resolve_types
        ../../gcc/fortran/resolve.cc:17562
0x87e4bc gfc_resolve(gfc_namespace*)
        ../../gcc/fortran/resolve.cc:17661
0x866092 gfc_parse_file()
        ../../gcc/fortran/parse.cc:6837
0x8b4d3f gfc_be_parse_file
        ../../gcc/fortran/f95-lang.cc:229

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

* [Bug fortran/107923] ICE in lookup_function_fuzzy_find_candidates / check_interface0
  2022-11-29 17:57 [Bug fortran/107923] New: ICE in lookup_function_fuzzy_find_candidates / check_interface0 gscfq@t-online.de
  2022-11-29 17:57 ` [Bug fortran/107923] " gscfq@t-online.de
@ 2022-11-30 12:42 ` marxin at gcc dot gnu.org
  2023-08-30 19:38 ` mikael at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-11-30 12:42 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Valgrind tells there's invalid memory read:

==9331== Invalid read of size 1
==9331==    at 0x180439A: check_interface0(gfc_interface*, char const*)
(interface.cc:1880)
==9331==    by 0x18048EA: check_sym_interfaces(gfc_symbol*) (interface.cc:2021)
==9331==    by 0x18969D2: do_traverse_symtree(gfc_symtree*, void
(*)(gfc_symtree*), void (*)(gfc_symbol*)) [clone .lto_priv.0] (symbol.cc:4174)
==9331==    by 0x1804685: UnknownInlinedFun (symbol.cc:4199)
==9331==    by 0x1804685: gfc_check_interfaces(gfc_namespace*)
(interface.cc:2132)
==9331==    by 0x18C983E: resolve_types(gfc_namespace*) [clone .lto_priv.0]
(resolve.cc:17504)
==9331==    by 0x18CA3F5: gfc_resolve(gfc_namespace*) [clone .part.0]
(resolve.cc:17603)
==9331==    by 0x188BA08: UnknownInlinedFun (resolve.cc:17590)
==9331==    by 0x188BA08: gfc_parse_file() (parse.cc:6810)
==9331==    by 0x18DBB4C: gfc_be_parse_file() [clone .lto_priv.0]
(f95-lang.cc:216)
==9331==    by 0x15CE664: compile_file() [clone .lto_priv.0] (toplev.cc:452)
==9331==    by 0x15AC09D: UnknownInlinedFun (toplev.cc:2144)
==9331==    by 0x15AC09D: toplev::main(int, char**) (toplev.cc:2296)
==9331==    by 0x15AB2C7: main (main.cc:39)
==9331==  Address 0x50590e4 is 84 bytes inside a block of size 344 free'd
==9331==    at 0x484717B: free (vg_replace_malloc.c:884)
==9331==    by 0x18C5495: gfc_free_symbol(gfc_symbol*&) (symbol.cc:3099)

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

* [Bug fortran/107923] ICE in lookup_function_fuzzy_find_candidates / check_interface0
  2022-11-29 17:57 [Bug fortran/107923] New: ICE in lookup_function_fuzzy_find_candidates / check_interface0 gscfq@t-online.de
  2022-11-29 17:57 ` [Bug fortran/107923] " gscfq@t-online.de
  2022-11-30 12:42 ` marxin at gcc dot gnu.org
@ 2023-08-30 19:38 ` mikael at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: mikael at gcc dot gnu.org @ 2023-08-30 19:38 UTC (permalink / raw)
  To: gcc-bugs

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

Mikael Morin <mikael at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
                 CC|                            |mikael at gcc dot gnu.org
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #3 from Mikael Morin <mikael at gcc dot gnu.org> ---
All the testcases here have been fixed by the fix for pr48776.
Closing as duplicate.

*** This bug has been marked as a duplicate of bug 48776 ***

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

end of thread, other threads:[~2023-08-30 19:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-29 17:57 [Bug fortran/107923] New: ICE in lookup_function_fuzzy_find_candidates / check_interface0 gscfq@t-online.de
2022-11-29 17:57 ` [Bug fortran/107923] " gscfq@t-online.de
2022-11-30 12:42 ` marxin at gcc dot gnu.org
2023-08-30 19:38 ` mikael 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).