public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/95981] New: ICE in gfc_find_array_ref(): No ref found
@ 2020-06-29 17:55 gscfq@t-online.de
  2020-06-29 18:51 ` [Bug fortran/95981] " kargl at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: gscfq@t-online.de @ 2020-06-29 17:55 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95981
           Summary: ICE in gfc_find_array_ref(): No ref found
           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 also versions down to at least r5.
With a missing attribute allocatable or pointer :


$ cat z1.f90
program p
   type t
   end type
   class(t) :: x(:)
   type(t) :: y(size(x,1))
end


$ gfortran-11-20200628 -c z1.f90
f951: internal compiler error: gfc_find_array_ref(): No ref found
0x657489 gfc_report_diagnostic
        ../../gcc/fortran/error.c:782
0x658baa gfc_internal_error(char const*, ...)
        ../../gcc/fortran/error.c:1402
0x628e4c gfc_find_array_ref(gfc_expr*, bool)
        ../../gcc/fortran/array.c:2750
0x629f7a dim_rank_check
        ../../gcc/fortran/check.c:1145
0x6317fc dim_rank_check
        ../../gcc/fortran/check.c:5140
0x6317fc gfc_check_size(gfc_expr*, gfc_expr*, gfc_expr*)
        ../../gcc/fortran/check.c:5135
0x66cf6c do_check
        ../../gcc/fortran/intrinsic.c:4749
0x66cf6c check_specific
        ../../gcc/fortran/intrinsic.c:4762
0x677264 gfc_intrinsic_func_interface(gfc_expr*, int)
        ../../gcc/fortran/intrinsic.c:4999
0x6c52d3 resolve_unknown_f
        ../../gcc/fortran/resolve.c:2902
0x6c52d3 resolve_function
        ../../gcc/fortran/resolve.c:3246
0x6c52d3 gfc_resolve_expr(gfc_expr*)
        ../../gcc/fortran/resolve.c:7037
0x64a4af variable_decl
        ../../gcc/fortran/decl.c:2595
0x64a4af gfc_match_data_decl()
        ../../gcc/fortran/decl.c:6197
0x6ae0a3 match_word
        ../../gcc/fortran/parse.c:65
0x6ae0a3 decode_statement
        ../../gcc/fortran/parse.c:376
0x6afaea next_free
        ../../gcc/fortran/parse.c:1280
0x6afaea next_statement
        ../../gcc/fortran/parse.c:1512
0x6b113b parse_spec
        ../../gcc/fortran/parse.c:3923
0x6b3f0c parse_progunit
        ../../gcc/fortran/parse.c:5852

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

* [Bug fortran/95981] ICE in gfc_find_array_ref(): No ref found
  2020-06-29 17:55 [Bug fortran/95981] New: ICE in gfc_find_array_ref(): No ref found gscfq@t-online.de
@ 2020-06-29 18:51 ` kargl at gcc dot gnu.org
  2020-07-13 14:12 ` cvs-commit at gcc dot gnu.org
  2020-07-14  7:11 ` markeggleston at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: kargl at gcc dot gnu.org @ 2020-06-29 18:51 UTC (permalink / raw)
  To: gcc-bugs

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

kargl at gcc dot gnu.org changed:

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

--- Comment #1 from kargl at gcc dot gnu.org ---
Patch is against svn revision 280156.

Index: gcc/fortran/check.c
===================================================================
--- gcc/fortran/check.c (revision 280157)
+++ gcc/fortran/check.c (working copy)
@@ -1137,7 +1137,9 @@ dim_rank_check (gfc_expr *dim, gfc_expr *array, int al

   if (array->expr_type == EXPR_VARIABLE)
     {
-      ar = gfc_find_array_ref (array);
+      ar = gfc_find_array_ref (array, true);
+      if (!ar)
+         return false;
       if (ar->as->type == AS_ASSUMED_SIZE
          && !allow_assumed
          && ar->type != AR_ELEMENT

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

* [Bug fortran/95981] ICE in gfc_find_array_ref(): No ref found
  2020-06-29 17:55 [Bug fortran/95981] New: ICE in gfc_find_array_ref(): No ref found gscfq@t-online.de
  2020-06-29 18:51 ` [Bug fortran/95981] " kargl at gcc dot gnu.org
@ 2020-07-13 14:12 ` cvs-commit at gcc dot gnu.org
  2020-07-14  7:11 ` markeggleston at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-07-13 14:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:3f069011019c9df670969ea283fd4d139f34a925

commit r11-2061-g3f069011019c9df670969ea283fd4d139f34a925
Author: Mark Eggleston <markeggleston@gcc.gnu.org>
Date:   Tue Jun 30 10:15:05 2020 +0100

    Fortran  :  ICE in gfc_find_array_ref(): No ref found PR95981

    When looking for an array reference allow NULL references.  If
    no array reference is found dim_rank_check should return false.

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

    gcc/fortran/

            PR fortran/95981
            * check.c (dim_rank_check): Allow NULL references in call to
            gfc_find_array_ref and return false if no reference is found.

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

    gcc/testsuite/

            PR fortran/95981
            * gfortran.dg/pr95981.f90: New test.

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

* [Bug fortran/95981] ICE in gfc_find_array_ref(): No ref found
  2020-06-29 17:55 [Bug fortran/95981] New: ICE in gfc_find_array_ref(): No ref found gscfq@t-online.de
  2020-06-29 18:51 ` [Bug fortran/95981] " kargl at gcc dot gnu.org
  2020-07-13 14:12 ` cvs-commit at gcc dot gnu.org
@ 2020-07-14  7:11 ` markeggleston at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: markeggleston at gcc dot gnu.org @ 2020-07-14  7:11 UTC (permalink / raw)
  To: gcc-bugs

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

markeggleston at gcc dot gnu.org changed:

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

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

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

end of thread, other threads:[~2020-07-14  7:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-29 17:55 [Bug fortran/95981] New: ICE in gfc_find_array_ref(): No ref found gscfq@t-online.de
2020-06-29 18:51 ` [Bug fortran/95981] " kargl at gcc dot gnu.org
2020-07-13 14:12 ` cvs-commit at gcc dot gnu.org
2020-07-14  7:11 ` markeggleston 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).