public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/101349] New: ICE in gfc_get_descriptor_field, at fortran/trans-array.c:140
@ 2021-07-06 17:35 gscfq@t-online.de
  2021-07-06 18:32 ` [Bug fortran/101349] " kargl at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: gscfq@t-online.de @ 2021-07-06 17:35 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101349
           Summary: ICE in gfc_get_descriptor_field, at
                    fortran/trans-array.c:140
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

With a missing attribute allocatable or pointer :
(affects version down to r6)


$ cat z1.f90
subroutine s(x)
   class(*) :: x(:)
   allocate (x, source=['abc'])
end


$ cat z2.f90   # ok
subroutine s(x)
   class(*), allocatable :: x(:)
   allocate (x, source=['abc'])
end


$ gfortran-12-20210704 -c z1.f90
z1.f90:3:31:

    3 |    allocate (x, source=['abc'])
      |                               1
internal compiler error: in gfc_get_descriptor_field, at
fortran/trans-array.c:140
0x7ad4f0 gfc_get_descriptor_field
        ../../gcc/fortran/trans-array.c:140
0x7ae7bf gfc_conv_descriptor_dtype(tree_node*)
        ../../gcc/fortran/trans-array.c:215
0x7b46d0 gfc_array_init_size
        ../../gcc/fortran/trans-array.c:5562
0x7b46d0 gfc_array_allocate(gfc_se*, gfc_expr*, tree_node*, tree_node*,
tree_node*, tree_node*, tree_node*, tree_node**, gfc_expr*, tree_node*, bool)
        ../../gcc/fortran/trans-array.c:5982
0x8256b7 gfc_trans_allocate(gfc_code*)
        ../../gcc/fortran/trans-stmt.c:6736
0x7acb47 trans_code
        ../../gcc/fortran/trans.c:2090
0x7d31a4 gfc_generate_function_code(gfc_namespace*)
        ../../gcc/fortran/trans-decl.c:6898
0x759926 translate_all_program_units
        ../../gcc/fortran/parse.c:6464
0x759926 gfc_parse_file()
        ../../gcc/fortran/parse.c:6733
0x7a5c4f gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:216

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

* [Bug fortran/101349] ICE in gfc_get_descriptor_field, at fortran/trans-array.c:140
  2021-07-06 17:35 [Bug fortran/101349] New: ICE in gfc_get_descriptor_field, at fortran/trans-array.c:140 gscfq@t-online.de
@ 2021-07-06 18:32 ` kargl at gcc dot gnu.org
  2021-08-30 19:31 ` anlauf at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: kargl at gcc dot gnu.org @ 2021-07-06 18:32 UTC (permalink / raw)
  To: gcc-bugs

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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2021-07-06
     Ever confirmed|0                           |1

--- Comment #1 from kargl at gcc dot gnu.org ---
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 45c3ad387ac..8365eb4caa8 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -7820,8 +7820,9 @@ resolve_allocate_expr (gfc_expr *e, gfc_code *code, bool
*array_alloc_wo_spec)
        }
     }

-  /* Check for F08:C628.  */
-  if (allocatable == 0 && pointer == 0 && !unlimited)
+  /* F08:C628.  (R632) Each allocate-object shall be a data pointer or
+     an allocatable variable.  */
+  if (allocatable == 0 && pointer == 0)
     {
       gfc_error ("Allocate-object at %L must be ALLOCATABLE or a POINTER",
                 &e->where);

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

* [Bug fortran/101349] ICE in gfc_get_descriptor_field, at fortran/trans-array.c:140
  2021-07-06 17:35 [Bug fortran/101349] New: ICE in gfc_get_descriptor_field, at fortran/trans-array.c:140 gscfq@t-online.de
  2021-07-06 18:32 ` [Bug fortran/101349] " kargl at gcc dot gnu.org
@ 2021-08-30 19:31 ` anlauf at gcc dot gnu.org
  2021-08-30 20:03 ` sgk at troutmask dot apl.washington.edu
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-08-30 19:31 UTC (permalink / raw)
  To: gcc-bugs

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

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 ---
Steve,

are you going to submit your patch?

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

* [Bug fortran/101349] ICE in gfc_get_descriptor_field, at fortran/trans-array.c:140
  2021-07-06 17:35 [Bug fortran/101349] New: ICE in gfc_get_descriptor_field, at fortran/trans-array.c:140 gscfq@t-online.de
  2021-07-06 18:32 ` [Bug fortran/101349] " kargl at gcc dot gnu.org
  2021-08-30 19:31 ` anlauf at gcc dot gnu.org
@ 2021-08-30 20:03 ` sgk at troutmask dot apl.washington.edu
  2021-08-30 20:42 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: sgk at troutmask dot apl.washington.edu @ 2021-08-30 20:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Mon, Aug 30, 2021 at 07:31:17PM +0000, anlauf at gcc dot gnu.org wrote:
> 
> --- Comment #2 from anlauf at gcc dot gnu.org ---
> Steve,
> 
> are you going to submit your patch?
> 

I submitted the patch to bugzilla.  Whether
it makes it into the repository is predicated
on new volunteers stepping into gfortran world.

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

* [Bug fortran/101349] ICE in gfc_get_descriptor_field, at fortran/trans-array.c:140
  2021-07-06 17:35 [Bug fortran/101349] New: ICE in gfc_get_descriptor_field, at fortran/trans-array.c:140 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2021-08-30 20:03 ` sgk at troutmask dot apl.washington.edu
@ 2021-08-30 20:42 ` cvs-commit at gcc dot gnu.org
  2021-08-30 20:49 ` anlauf at gcc dot gnu.org
  2021-09-03 19:18 ` cvs-commit at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-08-30 20:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:9213ff13247739d6d335064a6b568278a872a991

commit r12-3230-g9213ff13247739d6d335064a6b568278a872a991
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Mon Aug 30 22:41:01 2021 +0200

    Fortran - correct check for constraint F2008:C628 / F2018:C932

    gcc/fortran/ChangeLog:

            PR fortran/101349
            * resolve.c (resolve_allocate_expr): An unlimited polymorphic
            argument to ALLOCATE must be ALLOCATABLE or a POINTER.  Fix the
            corresponding check.

    gcc/testsuite/ChangeLog:

            PR fortran/101349
            * gfortran.dg/unlimited_polymorphic_33.f90: New test.

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

* [Bug fortran/101349] ICE in gfc_get_descriptor_field, at fortran/trans-array.c:140
  2021-07-06 17:35 [Bug fortran/101349] New: ICE in gfc_get_descriptor_field, at fortran/trans-array.c:140 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2021-08-30 20:42 ` cvs-commit at gcc dot gnu.org
@ 2021-08-30 20:49 ` anlauf at gcc dot gnu.org
  2021-09-03 19:18 ` cvs-commit at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-08-30 20:49 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

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

--- Comment #5 from anlauf at gcc dot gnu.org ---
Committed as obvious.  Fixed.

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

* [Bug fortran/101349] ICE in gfc_get_descriptor_field, at fortran/trans-array.c:140
  2021-07-06 17:35 [Bug fortran/101349] New: ICE in gfc_get_descriptor_field, at fortran/trans-array.c:140 gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2021-08-30 20:49 ` anlauf at gcc dot gnu.org
@ 2021-09-03 19:18 ` cvs-commit at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-09-03 19:18 UTC (permalink / raw)
  To: gcc-bugs

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

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

commit r11-8958-gf826c257b6fb64868fd12a52291d1b6f85e1689a
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Mon Aug 30 22:41:01 2021 +0200

    Fortran - correct check for constraint F2008:C628 / F2018:C932

    gcc/fortran/ChangeLog:

            PR fortran/101349
            * resolve.c (resolve_allocate_expr): An unlimited polymorphic
            argument to ALLOCATE must be ALLOCATABLE or a POINTER.  Fix the
            corresponding check.

    gcc/testsuite/ChangeLog:

            PR fortran/101349
            * gfortran.dg/unlimited_polymorphic_33.f90: New test.

    (cherry picked from commit 9213ff13247739d6d335064a6b568278a872a991)

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

end of thread, other threads:[~2021-09-03 19:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-06 17:35 [Bug fortran/101349] New: ICE in gfc_get_descriptor_field, at fortran/trans-array.c:140 gscfq@t-online.de
2021-07-06 18:32 ` [Bug fortran/101349] " kargl at gcc dot gnu.org
2021-08-30 19:31 ` anlauf at gcc dot gnu.org
2021-08-30 20:03 ` sgk at troutmask dot apl.washington.edu
2021-08-30 20:42 ` cvs-commit at gcc dot gnu.org
2021-08-30 20:49 ` anlauf at gcc dot gnu.org
2021-09-03 19:18 ` 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).