public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/95978] New: [10/11 Regression] ICE in gfc_match_data, at fortran/decl.c:731
@ 2020-06-29 17:50 gscfq@t-online.de
  2020-06-29 20:47 ` [Bug fortran/95978] " dominiq at lps dot ens.fr
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: gscfq@t-online.de @ 2020-06-29 17:50 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95978
           Summary: [10/11 Regression] ICE in gfc_match_data, at
                    fortran/decl.c:731
           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: ---

This changed between 20200223 and 20200308 :


$ cat z1.f90
program p
   type t
      integer :: a
      type(t), allocatable :: b
      data c /t(1)/
   end type
end


$ cat z2.f90
program p
   type t
      integer :: a
      class(*), allocatable :: b
      data c /t(1)/
   end type
end


$ gfortran-10-20200223 -c z1.f90
z1.f90:5:19:

    5 |       data c /t(1)/
      |                   1
Error: Unexpected DATA statement at (1)


$ gfortran-11-20200628 -c z1.f90
f951: internal compiler error: Segmentation fault
0xbd215f crash_signal
        ../../gcc/toplev.c:328
0x6419e5 gfc_match_data()
        ../../gcc/fortran/decl.c:731
0x6aacb1 match_word
        ../../gcc/fortran/parse.c:65
0x6aed7e decode_statement
        ../../gcc/fortran/parse.c:469
0x6afaea next_free
        ../../gcc/fortran/parse.c:1280
0x6afaea next_statement
        ../../gcc/fortran/parse.c:1512
0x6b1574 parse_derived
        ../../gcc/fortran/parse.c:3343
0x6b1574 parse_spec
        ../../gcc/fortran/parse.c:3884
0x6b3f0c parse_progunit
        ../../gcc/fortran/parse.c:5852
0x6b55e9 gfc_parse_file()
        ../../gcc/fortran/parse.c:6393
0x7016ff gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:212

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

* [Bug fortran/95978] [10/11 Regression] ICE in gfc_match_data, at fortran/decl.c:731
  2020-06-29 17:50 [Bug fortran/95978] New: [10/11 Regression] ICE in gfc_match_data, at fortran/decl.c:731 gscfq@t-online.de
@ 2020-06-29 20:47 ` dominiq at lps dot ens.fr
  2020-06-29 21:05 ` anlauf at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dominiq at lps dot ens.fr @ 2020-06-29 20:47 UTC (permalink / raw)
  To: gcc-bugs

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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-06-29
             Status|UNCONFIRMED                 |NEW
   Target Milestone|---                         |10.2
      Known to fail|                            |10.1.0, 11.0
           Priority|P3                          |P4
      Known to work|                            |9.3.0
     Ever confirmed|0                           |1

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
My build at 2019-12-18 doesn't give an ICE, gcc11-706 does. Probably a change
on master, back ported to GCC10.

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

* [Bug fortran/95978] [10/11 Regression] ICE in gfc_match_data, at fortran/decl.c:731
  2020-06-29 17:50 [Bug fortran/95978] New: [10/11 Regression] ICE in gfc_match_data, at fortran/decl.c:731 gscfq@t-online.de
  2020-06-29 20:47 ` [Bug fortran/95978] " dominiq at lps dot ens.fr
@ 2020-06-29 21:05 ` anlauf at gcc dot gnu.org
  2020-06-29 21:11 ` anlauf at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-06-29 21:05 UTC (permalink / raw)
  To: gcc-bugs

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

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 ---
The offending commit is c77b6f95e014ad1f6654683ff56f9508fe7f268d
by Mark and Steven.

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

* [Bug fortran/95978] [10/11 Regression] ICE in gfc_match_data, at fortran/decl.c:731
  2020-06-29 17:50 [Bug fortran/95978] New: [10/11 Regression] ICE in gfc_match_data, at fortran/decl.c:731 gscfq@t-online.de
  2020-06-29 20:47 ` [Bug fortran/95978] " dominiq at lps dot ens.fr
  2020-06-29 21:05 ` anlauf at gcc dot gnu.org
@ 2020-06-29 21:11 ` anlauf at gcc dot gnu.org
  2020-06-29 21:21 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-06-29 21:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from anlauf at gcc dot gnu.org ---
The obvious patch

diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index ac1f63f66e0..f38def4c291 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -728,7 +728,7 @@ gfc_match_data (void)
          gfc_constructor *c;
          c = gfc_constructor_first (new_data->value->expr->value.constructor);
          for (; c; c = gfc_constructor_next (c))
-           if (c->expr->ts.type == BT_BOZ)
+           if (c->expr && c->expr->ts.type == BT_BOZ)
              {
                gfc_error ("BOZ literal constant at %L cannot appear in a "
                           "structure constructor", &c->expr->where);

leads to:

z1.f90:5:19:

    5 |       data c /t(1)/
      |                   1
Error: Unexpected DATA statement at (1)

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

* [Bug fortran/95978] [10/11 Regression] ICE in gfc_match_data, at fortran/decl.c:731
  2020-06-29 17:50 [Bug fortran/95978] New: [10/11 Regression] ICE in gfc_match_data, at fortran/decl.c:731 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2020-06-29 21:11 ` anlauf at gcc dot gnu.org
@ 2020-06-29 21:21 ` cvs-commit at gcc dot gnu.org
  2020-06-29 21:25 ` anlauf at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-29 21:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:583812c2e2f3593823622b0a5821d957c832dbd0

commit r11-1720-g583812c2e2f3593823622b0a5821d957c832dbd0
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Mon Jun 29 23:20:16 2020 +0200

    PR fortran/95978 - ICE in gfc_match_data, at fortran/decl.c:731

    Catch NULL pointer dereference on invalid DATA statement.

    gcc/fortran/
            PR fortran/95978
            * decl.c (gfc_match_data): Avoid NULL pointer dereference.

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

* [Bug fortran/95978] [10/11 Regression] ICE in gfc_match_data, at fortran/decl.c:731
  2020-06-29 17:50 [Bug fortran/95978] New: [10/11 Regression] ICE in gfc_match_data, at fortran/decl.c:731 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2020-06-29 21:21 ` cvs-commit at gcc dot gnu.org
@ 2020-06-29 21:25 ` anlauf at gcc dot gnu.org
  2020-06-30 18:46 ` cvs-commit at gcc dot gnu.org
  2020-06-30 18:48 ` anlauf at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-06-29 21:25 UTC (permalink / raw)
  To: gcc-bugs

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

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

--- Comment #5 from anlauf at gcc dot gnu.org ---
Committed as obvious on master:

https://gcc.gnu.org/pipermail/fortran/2020-June/054650.html

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

* [Bug fortran/95978] [10/11 Regression] ICE in gfc_match_data, at fortran/decl.c:731
  2020-06-29 17:50 [Bug fortran/95978] New: [10/11 Regression] ICE in gfc_match_data, at fortran/decl.c:731 gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2020-06-29 21:25 ` anlauf at gcc dot gnu.org
@ 2020-06-30 18:46 ` cvs-commit at gcc dot gnu.org
  2020-06-30 18:48 ` anlauf at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-30 18:46 UTC (permalink / raw)
  To: gcc-bugs

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

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

commit r10-8400-gaa0868ffe0fd45891a9596bf4995f1b610243fa6
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Mon Jun 29 23:20:16 2020 +0200

    PR fortran/95978 - ICE in gfc_match_data, at fortran/decl.c:731

    Catch NULL pointer dereference on invalid DATA statement.

    gcc/fortran/
            PR fortran/95978
            * decl.c (gfc_match_data): Avoid NULL pointer dereference.

    (cherry picked from commit 583812c2e2f3593823622b0a5821d957c832dbd0)

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

* [Bug fortran/95978] [10/11 Regression] ICE in gfc_match_data, at fortran/decl.c:731
  2020-06-29 17:50 [Bug fortran/95978] New: [10/11 Regression] ICE in gfc_match_data, at fortran/decl.c:731 gscfq@t-online.de
                   ` (5 preceding siblings ...)
  2020-06-30 18:46 ` cvs-commit at gcc dot gnu.org
@ 2020-06-30 18:48 ` anlauf at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-06-30 18:48 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

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

--- Comment #7 from anlauf at gcc dot gnu.org ---
Fixed on master for gcc-11, and on 10-branch.

Thanks for the report!

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

end of thread, other threads:[~2020-06-30 18:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-29 17:50 [Bug fortran/95978] New: [10/11 Regression] ICE in gfc_match_data, at fortran/decl.c:731 gscfq@t-online.de
2020-06-29 20:47 ` [Bug fortran/95978] " dominiq at lps dot ens.fr
2020-06-29 21:05 ` anlauf at gcc dot gnu.org
2020-06-29 21:11 ` anlauf at gcc dot gnu.org
2020-06-29 21:21 ` cvs-commit at gcc dot gnu.org
2020-06-29 21:25 ` anlauf at gcc dot gnu.org
2020-06-30 18:46 ` cvs-commit at gcc dot gnu.org
2020-06-30 18:48 ` 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).