public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/95501] New: ICE in gfc_match_pointer_assignment, at fortran/match.c:1422
@ 2020-06-03 15:43 gscfq@t-online.de
  2020-06-03 17:02 ` [Bug fortran/95501] " kargl at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: gscfq@t-online.de @ 2020-06-03 15:43 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95501
           Summary: ICE in gfc_match_pointer_assignment, at
                    fortran/match.c:1422
           Product: gcc
           Version: 11.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 20181028 (error) and 20181104 (ICE) :


$ cat z1.f90
program p
   integer, target :: a = 2
   integer, pointer :: z
   z%kind => a%kind
   z%kind => a
end


$ cat z2.f90
program p
   character, target :: a = 'a'
   character, pointer :: z
   z%kind => a
   z%kind => a%kind
   z%len => a
   z%len => a%len
   a%kind => a%len
   a%len => a%kind
end


$ gfortran-11-20200531 -c z1.f90
f951: internal compiler error: Segmentation fault
0xbc37bf crash_signal
        ../../gcc/toplev.c:328
0x686c67 gfc_match_pointer_assignment()
        ../../gcc/fortran/match.c:1422
0x6aa97b match_word
        ../../gcc/fortran/parse.c:65
0x6aa97b decode_statement
        ../../gcc/fortran/parse.c:362
0x6ac41a next_free
        ../../gcc/fortran/parse.c:1279
0x6ac41a next_statement
        ../../gcc/fortran/parse.c:1511
0x6ada6b parse_spec
        ../../gcc/fortran/parse.c:3922
0x6b083c parse_progunit
        ../../gcc/fortran/parse.c:5851
0x6b1f19 gfc_parse_file()
        ../../gcc/fortran/parse.c:6392
0x6fdfff gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:210

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

* [Bug fortran/95501] ICE in gfc_match_pointer_assignment, at fortran/match.c:1422
  2020-06-03 15:43 [Bug fortran/95501] New: ICE in gfc_match_pointer_assignment, at fortran/match.c:1422 gscfq@t-online.de
@ 2020-06-03 17:02 ` kargl at gcc dot gnu.org
  2020-06-09 11:41 ` marxin at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: kargl at gcc dot gnu.org @ 2020-06-03 17:02 UTC (permalink / raw)
  To: gcc-bugs

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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2020-06-03
           Priority|P3                          |P4
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #1 from kargl at gcc dot gnu.org ---
Fixes z1.f90 and z2.90.

Index: gcc/fortran/match.c
===================================================================
--- gcc/fortran/match.c (revision 280157)
+++ gcc/fortran/match.c (working copy)
@@ -1394,7 +1394,7 @@ gfc_match_pointer_assignment (void)
   gfc_matching_procptr_assignment = 0;

   m = gfc_match (" %v =>", &lvalue);
-  if (m != MATCH_YES)
+  if (m != MATCH_YES || !lvalue->symtree)
     {
       m = MATCH_NO;
       goto cleanup;

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

* [Bug fortran/95501] ICE in gfc_match_pointer_assignment, at fortran/match.c:1422
  2020-06-03 15:43 [Bug fortran/95501] New: ICE in gfc_match_pointer_assignment, at fortran/match.c:1422 gscfq@t-online.de
  2020-06-03 17:02 ` [Bug fortran/95501] " kargl at gcc dot gnu.org
@ 2020-06-09 11:41 ` marxin at gcc dot gnu.org
  2021-06-05 20:40 ` anlauf at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-06-09 11:41 UTC (permalink / raw)
  To: gcc-bugs

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

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> ---
Started to ICE with r9-3803-ga5fbc2f36a291cbe.

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

* [Bug fortran/95501] ICE in gfc_match_pointer_assignment, at fortran/match.c:1422
  2020-06-03 15:43 [Bug fortran/95501] New: ICE in gfc_match_pointer_assignment, at fortran/match.c:1422 gscfq@t-online.de
  2020-06-03 17:02 ` [Bug fortran/95501] " kargl at gcc dot gnu.org
  2020-06-09 11:41 ` marxin at gcc dot gnu.org
@ 2021-06-05 20:40 ` anlauf at gcc dot gnu.org
  2021-06-16 19:54 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-06-05 20:40 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

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

--- Comment #3 from anlauf at gcc dot gnu.org ---
See also PR95502#3.

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

* [Bug fortran/95501] ICE in gfc_match_pointer_assignment, at fortran/match.c:1422
  2020-06-03 15:43 [Bug fortran/95501] New: ICE in gfc_match_pointer_assignment, at fortran/match.c:1422 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2021-06-05 20:40 ` anlauf at gcc dot gnu.org
@ 2021-06-16 19:54 ` cvs-commit at gcc dot gnu.org
  2021-06-16 20:05 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-06-16 19:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:72e3d92178b44a3722519ec68e72e307443bda70

commit r12-1540-g72e3d92178b44a3722519ec68e72e307443bda70
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Wed Jun 16 21:54:16 2021 +0200

    Fortran - ICE in gfc_check_do_variable, at fortran/parse.c:4446

    Avoid NULL pointer dereferences during error recovery.

    gcc/fortran/ChangeLog:

            PR fortran/95501
            PR fortran/95502
            * expr.c (gfc_check_pointer_assign): Avoid NULL pointer
            dereference.
            * match.c (gfc_match_pointer_assignment): Likewise.
            * parse.c (gfc_check_do_variable): Avoid comparison with NULL
            symtree.

    gcc/testsuite/ChangeLog:

            PR fortran/95501
            PR fortran/95502
            * gfortran.dg/pr95502.f90: New test.

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

* [Bug fortran/95501] ICE in gfc_match_pointer_assignment, at fortran/match.c:1422
  2020-06-03 15:43 [Bug fortran/95501] New: ICE in gfc_match_pointer_assignment, at fortran/match.c:1422 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2021-06-16 19:54 ` cvs-commit at gcc dot gnu.org
@ 2021-06-16 20:05 ` cvs-commit at gcc dot gnu.org
  2021-06-18 18:21 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-06-16 20:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:cfe0a2ec26867b290eb84af00317e60f8b67455c

commit r12-1542-gcfe0a2ec26867b290eb84af00317e60f8b67455c
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Wed Jun 16 22:04:22 2021 +0200

    Fortran - ICE in gfc_check_do_variable, at fortran/parse.c:4446

    Avoid NULL pointer dereferences during error recovery.

    gcc/fortran/ChangeLog:

            PR fortran/95501
            PR fortran/95502
            * expr.c (gfc_check_pointer_assign): Avoid NULL pointer
            dereference.
            * match.c (gfc_match_pointer_assignment): Likewise.
            * parse.c (gfc_check_do_variable): Avoid comparison with NULL
            symtree.

    gcc/testsuite/ChangeLog:

            PR fortran/95501
            PR fortran/95502
            * gfortran.dg/pr95502.f90: New test.

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

* [Bug fortran/95501] ICE in gfc_match_pointer_assignment, at fortran/match.c:1422
  2020-06-03 15:43 [Bug fortran/95501] New: ICE in gfc_match_pointer_assignment, at fortran/match.c:1422 gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2021-06-16 20:05 ` cvs-commit at gcc dot gnu.org
@ 2021-06-18 18:21 ` cvs-commit at gcc dot gnu.org
  2021-06-18 18:42 ` cvs-commit at gcc dot gnu.org
  2021-06-18 18:45 ` anlauf at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-06-18 18:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:067e45a6f376582b1d3d36cc9b2124b60093b5c2

commit r11-8622-g067e45a6f376582b1d3d36cc9b2124b60093b5c2
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Wed Jun 16 22:04:22 2021 +0200

    Fortran - ICE in gfc_check_do_variable, at fortran/parse.c:4446

    Avoid NULL pointer dereferences during error recovery.

    gcc/fortran/ChangeLog:

            PR fortran/95501
            PR fortran/95502
            * expr.c (gfc_check_pointer_assign): Avoid NULL pointer
            dereference.
            * match.c (gfc_match_pointer_assignment): Likewise.
            * parse.c (gfc_check_do_variable): Avoid comparison with NULL
            symtree.

    gcc/testsuite/ChangeLog:

            PR fortran/95501
            PR fortran/95502
            * gfortran.dg/pr95502.f90: New test.

    (cherry picked from commit cfe0a2ec26867b290eb84af00317e60f8b67455c)

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

* [Bug fortran/95501] ICE in gfc_match_pointer_assignment, at fortran/match.c:1422
  2020-06-03 15:43 [Bug fortran/95501] New: ICE in gfc_match_pointer_assignment, at fortran/match.c:1422 gscfq@t-online.de
                   ` (5 preceding siblings ...)
  2021-06-18 18:21 ` cvs-commit at gcc dot gnu.org
@ 2021-06-18 18:42 ` cvs-commit at gcc dot gnu.org
  2021-06-18 18:45 ` anlauf at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-06-18 18:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 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:0c084361a5a800ee0920bf29b6673816d2b35e76

commit r10-9946-g0c084361a5a800ee0920bf29b6673816d2b35e76
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Wed Jun 16 22:04:22 2021 +0200

    Fortran - ICE in gfc_check_do_variable, at fortran/parse.c:4446

    Avoid NULL pointer dereferences during error recovery.

    gcc/fortran/ChangeLog:

            PR fortran/95501
            PR fortran/95502
            * expr.c (gfc_check_pointer_assign): Avoid NULL pointer
            dereference.
            * match.c (gfc_match_pointer_assignment): Likewise.
            * parse.c (gfc_check_do_variable): Avoid comparison with NULL
            symtree.

    gcc/testsuite/ChangeLog:

            PR fortran/95501
            PR fortran/95502
            * gfortran.dg/pr95502.f90: New test.

    (cherry picked from commit cfe0a2ec26867b290eb84af00317e60f8b67455c)

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

* [Bug fortran/95501] ICE in gfc_match_pointer_assignment, at fortran/match.c:1422
  2020-06-03 15:43 [Bug fortran/95501] New: ICE in gfc_match_pointer_assignment, at fortran/match.c:1422 gscfq@t-online.de
                   ` (6 preceding siblings ...)
  2021-06-18 18:42 ` cvs-commit at gcc dot gnu.org
@ 2021-06-18 18:45 ` anlauf at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-06-18 18:45 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

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

--- Comment #8 from anlauf at gcc dot gnu.org ---
Fixed on mainline for gcc-12, and backported to 11- and 10-branch.  Closing.

Thanks for the report!

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

end of thread, other threads:[~2021-06-18 18:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-03 15:43 [Bug fortran/95501] New: ICE in gfc_match_pointer_assignment, at fortran/match.c:1422 gscfq@t-online.de
2020-06-03 17:02 ` [Bug fortran/95501] " kargl at gcc dot gnu.org
2020-06-09 11:41 ` marxin at gcc dot gnu.org
2021-06-05 20:40 ` anlauf at gcc dot gnu.org
2021-06-16 19:54 ` cvs-commit at gcc dot gnu.org
2021-06-16 20:05 ` cvs-commit at gcc dot gnu.org
2021-06-18 18:21 ` cvs-commit at gcc dot gnu.org
2021-06-18 18:42 ` cvs-commit at gcc dot gnu.org
2021-06-18 18:45 ` 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).