* [Bug fortran/95342] [9/10/11 Regression] ICE in gfc_match_subroutine, at fortran/decl.c:7913
2020-05-26 16:45 [Bug fortran/95342] New: [9/10/11 Regression] ICE in gfc_match_subroutine, at fortran/decl.c:7913 gscfq@t-online.de
@ 2020-05-26 16:46 ` gscfq@t-online.de
2020-05-26 18:16 ` kargl at gcc dot gnu.org
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: gscfq@t-online.de @ 2020-05-26 16:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95342
G. Steinmetz <gscfq@t-online.de> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-invalid-code
--- Comment #1 from G. Steinmetz <gscfq@t-online.de> ---
Related :
$ cat z2.f90
module m
interface
module function f()
end
end interface
interface
function f() bind(c)
end
end interface
end
$ gfortran-11-20200524 -c z2.f90
f951: internal compiler error: Segmentation fault
0xbc0f6f crash_signal
../../gcc/toplev.c:328
0x643eeb gfc_match_function_decl()
../../gcc/fortran/decl.c:7398
0x6a82ca decode_statement
../../gcc/fortran/parse.c:343
0x6a9e1a next_free
../../gcc/fortran/parse.c:1279
0x6a9e1a next_statement
../../gcc/fortran/parse.c:1511
0x6aba5c parse_interface
../../gcc/fortran/parse.c:3519
0x6aba5c parse_spec
../../gcc/fortran/parse.c:3875
0x6af43e parse_module
../../gcc/fortran/parse.c:6115
0x6af787 gfc_parse_file()
../../gcc/fortran/parse.c:6428
0x6fb9af gfc_be_parse_file
../../gcc/fortran/f95-lang.c:210
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/95342] [9/10/11 Regression] ICE in gfc_match_subroutine, at fortran/decl.c:7913
2020-05-26 16:45 [Bug fortran/95342] New: [9/10/11 Regression] ICE in gfc_match_subroutine, at fortran/decl.c:7913 gscfq@t-online.de
2020-05-26 16:46 ` [Bug fortran/95342] " gscfq@t-online.de
@ 2020-05-26 18:16 ` kargl at gcc dot gnu.org
2020-05-26 18:29 ` kargl at gcc dot gnu.org
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: kargl at gcc dot gnu.org @ 2020-05-26 18:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95342
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kargl at gcc dot gnu.org
--- Comment #2 from kargl at gcc dot gnu.org ---
(In reply to G. Steinmetz from comment #1)
> Related :
>
>
> $ cat z2.f90
> module m
> interface
> module function f()
> end
> end interface
> interface
> function f() bind(c)
> end
> end interface
> end
>
>
> $ gfortran-11-20200524 -c z2.f90
> f951: internal compiler error: Segmentation fault
> 0xbc0f6f crash_signal
> ../../gcc/toplev.c:328
> 0x643eeb gfc_match_function_decl()
> ../../gcc/fortran/decl.c:7398
> 0x6a82ca decode_statement
> ../../gcc/fortran/parse.c:343
> 0x6a9e1a next_free
> ../../gcc/fortran/parse.c:1279
> 0x6a9e1a next_statement
> ../../gcc/fortran/parse.c:1511
> 0x6aba5c parse_interface
> ../../gcc/fortran/parse.c:3519
> 0x6aba5c parse_spec
> ../../gcc/fortran/parse.c:3875
> 0x6af43e parse_module
> ../../gcc/fortran/parse.c:6115
> 0x6af787 gfc_parse_file()
> ../../gcc/fortran/parse.c:6428
> 0x6fb9af gfc_be_parse_file
> ../../gcc/fortran/f95-lang.c:210
Index: gcc/fortran/decl.c
===================================================================
--- gcc/fortran/decl.c (revision 280157)
+++ gcc/fortran/decl.c (working copy)
@@ -7325,7 +7325,8 @@ gfc_match_function_decl (void)
procedure interface body. */
if (sym->attr.is_bind_c && sym->attr.module_procedure && sym->old_symbol
&& strcmp (sym->name, sym->old_symbol->name) == 0
- && strcmp (sym->binding_label, sym->old_symbol->binding_label) != 0)
+ && (!sym->old_symbol->binding_label
+ || strcmp (sym->binding_label, sym->old_symbol->binding_label) !=
0))
{
const char *null = "NULL", *s1, *s2;
s1 = sym->binding_label;
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/95342] [9/10/11 Regression] ICE in gfc_match_subroutine, at fortran/decl.c:7913
2020-05-26 16:45 [Bug fortran/95342] New: [9/10/11 Regression] ICE in gfc_match_subroutine, at fortran/decl.c:7913 gscfq@t-online.de
2020-05-26 16:46 ` [Bug fortran/95342] " gscfq@t-online.de
2020-05-26 18:16 ` kargl at gcc dot gnu.org
@ 2020-05-26 18:29 ` kargl at gcc dot gnu.org
2020-05-27 7:38 ` rguenth at gcc dot gnu.org
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: kargl at gcc dot gnu.org @ 2020-05-26 18:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95342
--- Comment #3 from kargl at gcc dot gnu.org ---
(In reply to kargl from comment #2)
> (In reply to G. Steinmetz from comment #1)
> > Related :
> >
> >
> > $ cat z2.f90
> > module m
> > interface
> > module function f()
> > end
> > end interface
> > interface
> > function f() bind(c)
> > end
> > end interface
> > end
> >
> >
> > $ gfortran-11-20200524 -c z2.f90
> > f951: internal compiler error: Segmentation fault
> > 0xbc0f6f crash_signal
> > ../../gcc/toplev.c:328
> > 0x643eeb gfc_match_function_decl()
> > ../../gcc/fortran/decl.c:7398
> > 0x6a82ca decode_statement
> > ../../gcc/fortran/parse.c:343
> > 0x6a9e1a next_free
> > ../../gcc/fortran/parse.c:1279
> > 0x6a9e1a next_statement
> > ../../gcc/fortran/parse.c:1511
> > 0x6aba5c parse_interface
> > ../../gcc/fortran/parse.c:3519
> > 0x6aba5c parse_spec
> > ../../gcc/fortran/parse.c:3875
> > 0x6af43e parse_module
> > ../../gcc/fortran/parse.c:6115
> > 0x6af787 gfc_parse_file()
> > ../../gcc/fortran/parse.c:6428
> > 0x6fb9af gfc_be_parse_file
> > ../../gcc/fortran/f95-lang.c:210
>
> Index: gcc/fortran/decl.c
> ===================================================================
> --- gcc/fortran/decl.c (revision 280157)
> +++ gcc/fortran/decl.c (working copy)
> @@ -7325,7 +7325,8 @@ gfc_match_function_decl (void)
> procedure interface body. */
> if (sym->attr.is_bind_c && sym->attr.module_procedure && sym->old_symbol
> && strcmp (sym->name, sym->old_symbol->name) == 0
> - && strcmp (sym->binding_label, sym->old_symbol->binding_label) != 0)
> + && (!sym->old_symbol->binding_label
> + || strcmp (sym->binding_label, sym->old_symbol->binding_label) != 0))
> {
> const char *null = "NULL", *s1, *s2;
> s1 = sym->binding_label;
Index: gcc/fortran/decl.c
===================================================================
--- gcc/fortran/decl.c (revision 280157)
+++ gcc/fortran/decl.c (working copy)
@@ -7325,7 +7325,8 @@ gfc_match_function_decl (void)
procedure interface body. */
if (sym->attr.is_bind_c && sym->attr.module_procedure && sym->old_symbol
&& strcmp (sym->name, sym->old_symbol->name) == 0
- && strcmp (sym->binding_label, sym->old_symbol->binding_label) != 0)
+ && (!sym->old_symbol->binding_label
+ || strcmp (sym->binding_label, sym->old_symbol->binding_label) !=
0))
{
const char *null = "NULL", *s1, *s2;
s1 = sym->binding_label;
@@ -7840,7 +7841,8 @@ gfc_match_subroutine (void)
procedure interface body. */
if (sym->attr.module_procedure && sym->old_symbol
&& strcmp (sym->name, sym->old_symbol->name) == 0
- && strcmp (sym->binding_label, sym->old_symbol->binding_label) != 0)
+ && (!sym->old_symbol->binding_label
+ || strcmp (sym->binding_label, sym->old_symbol->binding_label) !=
0))
{
const char *null = "NULL", *s1, *s2;
s1 = sym->binding_label;
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/95342] [9/10/11 Regression] ICE in gfc_match_subroutine, at fortran/decl.c:7913
2020-05-26 16:45 [Bug fortran/95342] New: [9/10/11 Regression] ICE in gfc_match_subroutine, at fortran/decl.c:7913 gscfq@t-online.de
` (2 preceding siblings ...)
2020-05-26 18:29 ` kargl at gcc dot gnu.org
@ 2020-05-27 7:38 ` rguenth at gcc dot gnu.org
2020-06-09 10:54 ` dominiq at lps dot ens.fr
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-05-27 7:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95342
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P4
Target Milestone|--- |9.4
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/95342] [9/10/11 Regression] ICE in gfc_match_subroutine, at fortran/decl.c:7913
2020-05-26 16:45 [Bug fortran/95342] New: [9/10/11 Regression] ICE in gfc_match_subroutine, at fortran/decl.c:7913 gscfq@t-online.de
` (3 preceding siblings ...)
2020-05-27 7:38 ` rguenth at gcc dot gnu.org
@ 2020-06-09 10:54 ` dominiq at lps dot ens.fr
2020-11-26 21:27 ` anlauf at gcc dot gnu.org
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: dominiq at lps dot ens.fr @ 2020-06-09 10:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95342
Dominique d'Humieres <dominiq at lps dot ens.fr> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
Last reconfirmed| |2020-06-09
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/95342] [9/10/11 Regression] ICE in gfc_match_subroutine, at fortran/decl.c:7913
2020-05-26 16:45 [Bug fortran/95342] New: [9/10/11 Regression] ICE in gfc_match_subroutine, at fortran/decl.c:7913 gscfq@t-online.de
` (4 preceding siblings ...)
2020-06-09 10:54 ` dominiq at lps dot ens.fr
@ 2020-11-26 21:27 ` anlauf at gcc dot gnu.org
2020-12-03 19:33 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-11-26 21:27 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95342
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
CC| |anlauf at gcc dot gnu.org
Known to fail| |10.2.1, 11.0, 9.3.1
Assignee|unassigned at gcc dot gnu.org |anlauf at gcc dot gnu.org
Known to work| |7.4.1, 8.4.1
--- Comment #4 from anlauf at gcc dot gnu.org ---
Patch: https://gcc.gnu.org/pipermail/fortran/2020-November/055356.html
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/95342] [9/10/11 Regression] ICE in gfc_match_subroutine, at fortran/decl.c:7913
2020-05-26 16:45 [Bug fortran/95342] New: [9/10/11 Regression] ICE in gfc_match_subroutine, at fortran/decl.c:7913 gscfq@t-online.de
` (5 preceding siblings ...)
2020-11-26 21:27 ` anlauf at gcc dot gnu.org
@ 2020-12-03 19:33 ` cvs-commit at gcc dot gnu.org
2020-12-04 22:18 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-12-03 19:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95342
--- Comment #5 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:30b606bb9b9314010a446ea4bed3481632008f75
commit r11-5727-g30b606bb9b9314010a446ea4bed3481632008f75
Author: Harald Anlauf <anlauf@gmx.de>
Date: Thu Dec 3 20:33:22 2020 +0100
PR fortran/95342 - ICE in gfc_match_subroutine, at fortran/decl.c:7913
Add checks for NULL pointers before dereferencing them.
gcc/fortran/ChangeLog:
PR fortran/95342
* decl.c (gfc_match_function_decl): Avoid NULL pointer dereference.
(gfc_match_subroutine): Likewise.
gcc/testsuite/ChangeLog:
PR fortran/95342
* gfortran.dg/pr95342.f90: New test.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/95342] [9/10/11 Regression] ICE in gfc_match_subroutine, at fortran/decl.c:7913
2020-05-26 16:45 [Bug fortran/95342] New: [9/10/11 Regression] ICE in gfc_match_subroutine, at fortran/decl.c:7913 gscfq@t-online.de
` (6 preceding siblings ...)
2020-12-03 19:33 ` cvs-commit at gcc dot gnu.org
@ 2020-12-04 22:18 ` cvs-commit at gcc dot gnu.org
2020-12-04 22:31 ` cvs-commit at gcc dot gnu.org
2020-12-04 22:33 ` anlauf at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-12-04 22:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95342
--- Comment #6 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:316a185ee29c9e6ec060762e76d25b64c60fd665
commit r10-9122-g316a185ee29c9e6ec060762e76d25b64c60fd665
Author: Harald Anlauf <anlauf@gmx.de>
Date: Thu Dec 3 20:33:22 2020 +0100
PR fortran/95342 - ICE in gfc_match_subroutine, at fortran/decl.c:7913
Add checks for NULL pointers before dereferencing them.
gcc/fortran/ChangeLog:
PR fortran/95342
* decl.c (gfc_match_function_decl): Avoid NULL pointer dereference.
(gfc_match_subroutine): Likewise.
gcc/testsuite/ChangeLog:
PR fortran/95342
* gfortran.dg/pr95342.f90: New test.
(cherry picked from commit 30b606bb9b9314010a446ea4bed3481632008f75)
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/95342] [9/10/11 Regression] ICE in gfc_match_subroutine, at fortran/decl.c:7913
2020-05-26 16:45 [Bug fortran/95342] New: [9/10/11 Regression] ICE in gfc_match_subroutine, at fortran/decl.c:7913 gscfq@t-online.de
` (7 preceding siblings ...)
2020-12-04 22:18 ` cvs-commit at gcc dot gnu.org
@ 2020-12-04 22:31 ` cvs-commit at gcc dot gnu.org
2020-12-04 22:33 ` anlauf at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-12-04 22:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95342
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:
https://gcc.gnu.org/g:34e72e050bf4e23689af7061f6381b95339eb7fa
commit r9-9099-g34e72e050bf4e23689af7061f6381b95339eb7fa
Author: Harald Anlauf <anlauf@gmx.de>
Date: Thu Dec 3 20:33:22 2020 +0100
PR fortran/95342 - ICE in gfc_match_subroutine, at fortran/decl.c:7913
Add checks for NULL pointers before dereferencing them.
gcc/fortran/ChangeLog:
PR fortran/95342
* decl.c (gfc_match_function_decl): Avoid NULL pointer dereference.
(gfc_match_subroutine): Likewise.
gcc/testsuite/ChangeLog:
PR fortran/95342
* gfortran.dg/pr95342.f90: New test.
(cherry picked from commit 30b606bb9b9314010a446ea4bed3481632008f75)
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/95342] [9/10/11 Regression] ICE in gfc_match_subroutine, at fortran/decl.c:7913
2020-05-26 16:45 [Bug fortran/95342] New: [9/10/11 Regression] ICE in gfc_match_subroutine, at fortran/decl.c:7913 gscfq@t-online.de
` (8 preceding siblings ...)
2020-12-04 22:31 ` cvs-commit at gcc dot gnu.org
@ 2020-12-04 22:33 ` anlauf at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-12-04 22:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95342
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #8 from anlauf at gcc dot gnu.org ---
For on mainline for gcc-11, and on 10- and 9-branch. Closing.
Thanks for the report!
^ permalink raw reply [flat|nested] 11+ messages in thread