public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/95585] New: ICE in gfc_check_reshape, at fortran/check.c:4751
@ 2020-06-08 18:47 gscfq@t-online.de
  2020-06-08 21:03 ` [Bug fortran/95585] " kargl at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: gscfq@t-online.de @ 2020-06-08 18:47 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95585
           Summary: ICE in gfc_check_reshape, at fortran/check.c:4751
           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 at least r5 :


$ cat z1.f90
program p
   integer, parameter :: a(2) = reshape([1, 2], a)
end


$ gfortran-11-20200607 -c z1.f90
f951: internal compiler error: Segmentation fault
0xbc593f crash_signal
        ../../gcc/toplev.c:328
0x62e589 gfc_check_reshape(gfc_expr*, gfc_expr*, gfc_expr*, gfc_expr*)
        ../../gcc/fortran/check.c:4751
0x66a55c do_check
        ../../gcc/fortran/intrinsic.c:4737
0x66a55c check_specific
        ../../gcc/fortran/intrinsic.c:4750
0x674854 gfc_intrinsic_func_interface(gfc_expr*, int)
        ../../gcc/fortran/intrinsic.c:4987
0x6c2733 resolve_unknown_f
        ../../gcc/fortran/resolve.c:2902
0x6c2733 resolve_function
        ../../gcc/fortran/resolve.c:3246
0x6c2733 gfc_resolve_expr(gfc_expr*)
        ../../gcc/fortran/resolve.c:7040
0x65a154 gfc_reduce_init_expr(gfc_expr*)
        ../../gcc/fortran/expr.c:3085
0x65d3e0 gfc_match_init_expr(gfc_expr**)
        ../../gcc/fortran/expr.c:3133
0x648c84 variable_decl
        ../../gcc/fortran/decl.c:2886
0x648c84 gfc_match_data_decl()
        ../../gcc/fortran/decl.c:6195
0x6ab513 match_word
        ../../gcc/fortran/parse.c:65
0x6ab513 decode_statement
        ../../gcc/fortran/parse.c:376
0x6acf5a next_free
        ../../gcc/fortran/parse.c:1279
0x6acf5a next_statement
        ../../gcc/fortran/parse.c:1511
0x6af304 parse_spec
        ../../gcc/fortran/parse.c:3738
0x6b137c parse_progunit
        ../../gcc/fortran/parse.c:5851
0x6b2a59 gfc_parse_file()
        ../../gcc/fortran/parse.c:6392
0x6feb3f gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:212

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

* [Bug fortran/95585] ICE in gfc_check_reshape, at fortran/check.c:4751
  2020-06-08 18:47 [Bug fortran/95585] New: ICE in gfc_check_reshape, at fortran/check.c:4751 gscfq@t-online.de
@ 2020-06-08 21:03 ` kargl at gcc dot gnu.org
  2020-06-22 12:15 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: kargl at gcc dot gnu.org @ 2020-06-08 21:03 UTC (permalink / raw)
  To: gcc-bugs

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

kargl at gcc dot gnu.org changed:

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

--- Comment #1 from kargl at gcc dot gnu.org ---
Index: gcc/fortran/check.c
===================================================================
--- gcc/fortran/check.c (revision 280157)
@@ -4720,7 +4728,8 @@ gfc_check_reshape (gfc_expr *source, gfc_expr *shape,
           && shape->ref->u.ar.as->lower[0]->ts.type == BT_INTEGER
           && shape->ref->u.ar.as->upper[0]->expr_type == EXPR_CONSTANT
           && shape->ref->u.ar.as->upper[0]->ts.type == BT_INTEGER
-          && shape->symtree->n.sym->attr.flavor == FL_PARAMETER)
+          && shape->symtree->n.sym->attr.flavor == FL_PARAMETER
+          && shape->symtree->n.sym->value)
     {
       int i, extent;
       gfc_expr *e, *v;

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

* [Bug fortran/95585] ICE in gfc_check_reshape, at fortran/check.c:4751
  2020-06-08 18:47 [Bug fortran/95585] New: ICE in gfc_check_reshape, at fortran/check.c:4751 gscfq@t-online.de
  2020-06-08 21:03 ` [Bug fortran/95585] " kargl at gcc dot gnu.org
@ 2020-06-22 12:15 ` cvs-commit at gcc dot gnu.org
  2020-06-23  6:31 ` markeggleston at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-22 12:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Mark Eggleston
<markeggleston@gcc.gnu.org>:

https://gcc.gnu.org/g:d9aed5f1ccffc019ddf980e349caa3d092755cb4

commit r11-1584-gd9aed5f1ccffc019ddf980e349caa3d092755cb4
Author: Mark Eggleston <markeggleston@gcc.gnu.org>
Date:   Thu Jun 11 06:42:36 2020 +0100

    Fortran  : ICE in gfc_check_reshape PR95585

    Issue an error where an array is used before its definition
    instead of an ICE.

    2020-06-22  Steven G. Kargl  <kargl@gcc.gnu.org>

    gcc/fortran/

            PR fortran/95585
            * check.c (gfc_check_reshape): Add check for a value when
            the symbol has an attribute flavor FL_PARAMETER.

    2020-06-22  Mark Eggleston  <markeggleston@gcc.gnu.org>

    gcc/testsuite/

            PR fortran/95585
            * gfortran.dg/pr95585.f90: New test.

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

* [Bug fortran/95585] ICE in gfc_check_reshape, at fortran/check.c:4751
  2020-06-08 18:47 [Bug fortran/95585] New: ICE in gfc_check_reshape, at fortran/check.c:4751 gscfq@t-online.de
  2020-06-08 21:03 ` [Bug fortran/95585] " kargl at gcc dot gnu.org
  2020-06-22 12:15 ` cvs-commit at gcc dot gnu.org
@ 2020-06-23  6:31 ` markeggleston at gcc dot gnu.org
  2020-07-26  9:05 ` cvs-commit at gcc dot gnu.org
  2020-07-26 10:56 ` cvs-commit at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: markeggleston at gcc dot gnu.org @ 2020-06-23  6:31 UTC (permalink / raw)
  To: gcc-bugs

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

markeggleston at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED
                 CC|                            |markeggleston at gcc dot gnu.org

--- Comment #3 from markeggleston at gcc dot gnu.org ---
Committed to master.

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

* [Bug fortran/95585] ICE in gfc_check_reshape, at fortran/check.c:4751
  2020-06-08 18:47 [Bug fortran/95585] New: ICE in gfc_check_reshape, at fortran/check.c:4751 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2020-06-23  6:31 ` markeggleston at gcc dot gnu.org
@ 2020-07-26  9:05 ` cvs-commit at gcc dot gnu.org
  2020-07-26 10:56 ` cvs-commit at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-07-26  9:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Mark Eggleston
<markeggleston@gcc.gnu.org>:

https://gcc.gnu.org/g:7dcd5b38fa91326e120a7ebb6f521330d83ff757

commit r10-8534-g7dcd5b38fa91326e120a7ebb6f521330d83ff757
Author: Mark Eggleston <markeggleston@gcc.gnu.org>
Date:   Thu Jun 11 06:42:36 2020 +0100

    Fortran  : ICE in gfc_check_reshape PR95585

    Issue an error where an array is used before its definition
    instead of an ICE.

    2020-07-26  Steven G. Kargl  <kargl@gcc.gnu.org>

    gcc/fortran/

            PR fortran/95585
            * check.c (gfc_check_reshape): Add check for a value when
            the symbol has an attribute flavor FL_PARAMETER.

    2020-07-26  Mark Eggleston  <markeggleston@gcc.gnu.org>

    gcc/testsuite/

            PR fortran/95585
            * gfortran.dg/pr95585.f90: New test.

    (cherry picked from commit d9aed5f1ccffc019ddf980e349caa3d092755cb4)

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

* [Bug fortran/95585] ICE in gfc_check_reshape, at fortran/check.c:4751
  2020-06-08 18:47 [Bug fortran/95585] New: ICE in gfc_check_reshape, at fortran/check.c:4751 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2020-07-26  9:05 ` cvs-commit at gcc dot gnu.org
@ 2020-07-26 10:56 ` cvs-commit at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-07-26 10:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Mark Eggleston
<markeggleston@gcc.gnu.org>:

https://gcc.gnu.org/g:5aa8760e31909d278f28d7d4bb1479d7607228c6

commit r9-8767-g5aa8760e31909d278f28d7d4bb1479d7607228c6
Author: Mark Eggleston <markeggleston@gcc.gnu.org>
Date:   Thu Jun 11 06:42:36 2020 +0100

    Fortran  : ICE in gfc_check_reshape PR95585

    Issue an error where an array is used before its definition
    instead of an ICE.

    2020-07-26  Steven G. Kargl  <kargl@gcc.gnu.org>

    gcc/fortran/

            PR fortran/95585
            * check.c (gfc_check_reshape): Add check for a value when
            the symbol has an attribute flavor FL_PARAMETER.

    2020-07-26  Mark Eggleston  <markeggleston@gcc.gnu.org>

    gcc/testsuite/

            PR fortran/95585
            * gfortran.dg/pr95585.f90: New test.

    (cherry picked from commit d9aed5f1ccffc019ddf980e349caa3d092755cb4)

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

end of thread, other threads:[~2020-07-26 10:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-08 18:47 [Bug fortran/95585] New: ICE in gfc_check_reshape, at fortran/check.c:4751 gscfq@t-online.de
2020-06-08 21:03 ` [Bug fortran/95585] " kargl at gcc dot gnu.org
2020-06-22 12:15 ` cvs-commit at gcc dot gnu.org
2020-06-23  6:31 ` markeggleston at gcc dot gnu.org
2020-07-26  9:05 ` cvs-commit at gcc dot gnu.org
2020-07-26 10:56 ` cvs-commit 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).