public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/95709] New: [9/10/11 Regression] ICE in gfc_resolve_code, at fortran/resolve.c:11807
@ 2020-06-16 18:53 gscfq@t-online.de
  2020-06-17  6:24 ` [Bug fortran/95709] " rguenth at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: gscfq@t-online.de @ 2020-06-16 18:53 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95709
           Summary: [9/10/11 Regression] ICE in gfc_resolve_code, at
                    fortran/resolve.c:11807
           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: ---

Affects versions down to r8 (before 20180525), r7 rejects it :


$ cat z1.f90
program p
   integer, parameter :: i(1) = 1
   goto i(1)
 1 continue
end


$ cat z2.f90
program p
   integer, parameter :: i(0) = 0
   goto i(1)
end


$ cat z3.f90
program p
   integer, parameter :: i(0) = 0
   goto i(0)
   goto i(1)
   goto i(-1)
   goto i(i(0))
end


$ cat z4.f90
program p
   integer, parameter :: i(0) = 0
   integer :: j
   goto i%kind
   goto j%kind
   goto j%kind, (1)
end


$ gfortran-11-20200614 -c z1.f90
z1.f90:3:12:

    3 |    goto i(1)
      |            1
Warning: Deleted feature: Assigned GOTO statement at (1)
f951: internal compiler error: Segmentation fault
0xbcdd2f crash_signal
        ../../gcc/toplev.c:328
0x6c9c8c gfc_resolve_code(gfc_code*, gfc_namespace*)
        ../../gcc/fortran/resolve.c:11807
0x6cc0e7 resolve_codes
        ../../gcc/fortran/resolve.c:17257
0x6cc1ae gfc_resolve(gfc_namespace*)
        ../../gcc/fortran/resolve.c:17292
0x6b42ec resolve_all_program_units
        ../../gcc/fortran/parse.c:6245
0x6b42ec gfc_parse_file()
        ../../gcc/fortran/parse.c:6492
0x70036f gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:212

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

* [Bug fortran/95709] [9/10/11 Regression] ICE in gfc_resolve_code, at fortran/resolve.c:11807
  2020-06-16 18:53 [Bug fortran/95709] New: [9/10/11 Regression] ICE in gfc_resolve_code, at fortran/resolve.c:11807 gscfq@t-online.de
@ 2020-06-17  6:24 ` rguenth at gcc dot gnu.org
  2020-06-17 12:59 ` dominiq at lps dot ens.fr
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-06-17  6:24 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

* [Bug fortran/95709] [9/10/11 Regression] ICE in gfc_resolve_code, at fortran/resolve.c:11807
  2020-06-16 18:53 [Bug fortran/95709] New: [9/10/11 Regression] ICE in gfc_resolve_code, at fortran/resolve.c:11807 gscfq@t-online.de
  2020-06-17  6:24 ` [Bug fortran/95709] " rguenth at gcc dot gnu.org
@ 2020-06-17 12:59 ` dominiq at lps dot ens.fr
  2020-06-17 17:33 ` kargl at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dominiq at lps dot ens.fr @ 2020-06-17 12:59 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2020-06-17

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

* [Bug fortran/95709] [9/10/11 Regression] ICE in gfc_resolve_code, at fortran/resolve.c:11807
  2020-06-16 18:53 [Bug fortran/95709] New: [9/10/11 Regression] ICE in gfc_resolve_code, at fortran/resolve.c:11807 gscfq@t-online.de
  2020-06-17  6:24 ` [Bug fortran/95709] " rguenth at gcc dot gnu.org
  2020-06-17 12:59 ` dominiq at lps dot ens.fr
@ 2020-06-17 17:33 ` kargl at gcc dot gnu.org
  2020-07-02 20:42 ` anlauf at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: kargl at gcc dot gnu.org @ 2020-06-17 17:33 UTC (permalink / raw)
  To: gcc-bugs

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

kargl at gcc dot gnu.org changed:

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

--- Comment #1 from kargl at gcc dot gnu.org ---
Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c       (revision 280157)
+++ gcc/fortran/resolve.c       (working copy)
@@ -11740,7 +11740,8 @@ start:
        case EXEC_GOTO:
          if (code->expr1 != NULL)
            {
-             if (code->expr1->ts.type != BT_INTEGER)
+             if (code->expr1->expr_type == EXPR_CONSTANT
+                 || code->expr1->ts.type != BT_INTEGER)
                gfc_error ("ASSIGNED GOTO statement at %L requires an "
                           "INTEGER variable", &code->expr1->where);
              else if (code->expr1->symtree->n.sym->attr.assign != 1)

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

* [Bug fortran/95709] [9/10/11 Regression] ICE in gfc_resolve_code, at fortran/resolve.c:11807
  2020-06-16 18:53 [Bug fortran/95709] New: [9/10/11 Regression] ICE in gfc_resolve_code, at fortran/resolve.c:11807 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2020-06-17 17:33 ` kargl at gcc dot gnu.org
@ 2020-07-02 20:42 ` anlauf at gcc dot gnu.org
  2020-07-06 16:53 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-07-02 20:42 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

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

--- Comment #2 from anlauf at gcc dot gnu.org ---
Patch for review: https://gcc.gnu.org/pipermail/fortran/2020-July/054686.html

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

* [Bug fortran/95709] [9/10/11 Regression] ICE in gfc_resolve_code, at fortran/resolve.c:11807
  2020-06-16 18:53 [Bug fortran/95709] New: [9/10/11 Regression] ICE in gfc_resolve_code, at fortran/resolve.c:11807 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2020-07-02 20:42 ` anlauf at gcc dot gnu.org
@ 2020-07-06 16:53 ` cvs-commit at gcc dot gnu.org
  2020-07-08 18:33 ` 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 @ 2020-07-06 16:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 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:824084e72e388f81015e7f67922c75f50741355a

commit r11-1854-g824084e72e388f81015e7f67922c75f50741355a
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Mon Jul 6 18:52:39 2020 +0200

    PR fortran/95709 - ICE in gfc_resolve_code, at fortran/resolve.c:11807

    The legacy "assigned GOTO" accepts only scalar integer variables.
    Check for proper arguments.

    gcc/fortran/
            PR fortran/95709
            * resolve.c (gfc_resolve_code): Check for valid arguments to
            assigned GOTO.

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

* [Bug fortran/95709] [9/10/11 Regression] ICE in gfc_resolve_code, at fortran/resolve.c:11807
  2020-06-16 18:53 [Bug fortran/95709] New: [9/10/11 Regression] ICE in gfc_resolve_code, at fortran/resolve.c:11807 gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2020-07-06 16:53 ` cvs-commit at gcc dot gnu.org
@ 2020-07-08 18:33 ` cvs-commit at gcc dot gnu.org
  2020-07-08 18:42 ` cvs-commit at gcc dot gnu.org
  2020-07-08 18:44 ` anlauf at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-07-08 18:33 UTC (permalink / raw)
  To: gcc-bugs

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

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

commit r10-8439-g17327d6cc73672ada0c6608f70e0894144b1f54b
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Mon Jul 6 18:52:39 2020 +0200

    PR fortran/95709 - ICE in gfc_resolve_code, at fortran/resolve.c:11807

    The legacy "assigned GOTO" accepts only scalar integer variables.
    Check for proper arguments.

    gcc/fortran/
            PR fortran/95709
            * resolve.c (gfc_resolve_code): Check for valid arguments to
            assigned GOTO.

    (cherry picked from commit 824084e72e388f81015e7f67922c75f50741355a)

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

* [Bug fortran/95709] [9/10/11 Regression] ICE in gfc_resolve_code, at fortran/resolve.c:11807
  2020-06-16 18:53 [Bug fortran/95709] New: [9/10/11 Regression] ICE in gfc_resolve_code, at fortran/resolve.c:11807 gscfq@t-online.de
                   ` (5 preceding siblings ...)
  2020-07-08 18:33 ` cvs-commit at gcc dot gnu.org
@ 2020-07-08 18:42 ` cvs-commit at gcc dot gnu.org
  2020-07-08 18:44 ` anlauf at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-07-08 18:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 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:006fda1b17a4d55b6548a1b3bd7efd0d8e40b6c4

commit r9-8727-g006fda1b17a4d55b6548a1b3bd7efd0d8e40b6c4
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Mon Jul 6 18:52:39 2020 +0200

    PR fortran/95709 - ICE in gfc_resolve_code, at fortran/resolve.c:11807

    The legacy "assigned GOTO" accepts only scalar integer variables.
    Check for proper arguments.

    gcc/fortran/
            PR fortran/95709
            * resolve.c (gfc_resolve_code): Check for valid arguments to
            assigned GOTO.

    (cherry picked from commit 824084e72e388f81015e7f67922c75f50741355a)

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

* [Bug fortran/95709] [9/10/11 Regression] ICE in gfc_resolve_code, at fortran/resolve.c:11807
  2020-06-16 18:53 [Bug fortran/95709] New: [9/10/11 Regression] ICE in gfc_resolve_code, at fortran/resolve.c:11807 gscfq@t-online.de
                   ` (6 preceding siblings ...)
  2020-07-08 18:42 ` cvs-commit at gcc dot gnu.org
@ 2020-07-08 18:44 ` anlauf at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-07-08 18:44 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

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

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

Thanks for the report!

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

end of thread, other threads:[~2020-07-08 18:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-16 18:53 [Bug fortran/95709] New: [9/10/11 Regression] ICE in gfc_resolve_code, at fortran/resolve.c:11807 gscfq@t-online.de
2020-06-17  6:24 ` [Bug fortran/95709] " rguenth at gcc dot gnu.org
2020-06-17 12:59 ` dominiq at lps dot ens.fr
2020-06-17 17:33 ` kargl at gcc dot gnu.org
2020-07-02 20:42 ` anlauf at gcc dot gnu.org
2020-07-06 16:53 ` cvs-commit at gcc dot gnu.org
2020-07-08 18:33 ` cvs-commit at gcc dot gnu.org
2020-07-08 18:42 ` cvs-commit at gcc dot gnu.org
2020-07-08 18:44 ` 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).