public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/99326] New: [9/10/11 Regression] ICE in gfc_build_dummy_array_decl, at fortran/trans-decl.c:1299
@ 2021-03-01 17:09 gscfq@t-online.de
  2021-03-02  7:44 ` [Bug fortran/99326] " rguenth at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: gscfq@t-online.de @ 2021-03-01 17:09 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99326
           Summary: [9/10/11 Regression] ICE in
                    gfc_build_dummy_array_decl, at
                    fortran/trans-decl.c:1299
           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: ---

Started with r9, changed between 20181014 and 20181021 :


$ cat z1.f90
program p
   type t0
   end type
   type t
      class(t0), allocatable :: a(:)
   end type
contains
   subroutine s(x)
      class(t0) :: x(:)
      type(t) :: z
      associate (y => x)
         z%a = y
      end associate
   end
end


$ gfortran-9-20181014 -c z1.f90
z1.f90:11:23:

11 |       associate (y => x)
   |                       1
Error: Assumed shape array at (1) must be a dummy argument


$ gfortran-11-20210228 -c z1.f90
z1.f90:1:9:

    1 | program p
      |         1
internal compiler error: in gfc_build_dummy_array_decl, at
fortran/trans-decl.c:1299
0x754a97 gfc_build_dummy_array_decl
        ../../gcc/fortran/trans-decl.c:1299
0x759043 gfc_get_symbol_decl(gfc_symbol*)
        ../../gcc/fortran/trans-decl.c:1697
0x75c05f generate_local_decl
        ../../gcc/fortran/trans-decl.c:5950
0x71af42 do_traverse_symtree
        ../../gcc/fortran/symbol.c:4170
0x75d004 generate_local_vars
        ../../gcc/fortran/trans-decl.c:6156
0x75d004 gfc_generate_function_code(gfc_namespace*)
        ../../gcc/fortran/trans-decl.c:6815
0x75cfe4 gfc_generate_contained_functions
        ../../gcc/fortran/trans-decl.c:5874
0x75cfe4 gfc_generate_function_code(gfc_namespace*)
        ../../gcc/fortran/trans-decl.c:6812
0x6e3a46 translate_all_program_units
        ../../gcc/fortran/parse.c:6351
0x6e3a46 gfc_parse_file()
        ../../gcc/fortran/parse.c:6620
0x72fd7f gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:212

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

* [Bug fortran/99326] [9/10/11 Regression] ICE in gfc_build_dummy_array_decl, at fortran/trans-decl.c:1299
  2021-03-01 17:09 [Bug fortran/99326] New: [9/10/11 Regression] ICE in gfc_build_dummy_array_decl, at fortran/trans-decl.c:1299 gscfq@t-online.de
@ 2021-03-02  7:44 ` rguenth at gcc dot gnu.org
  2021-03-02  9:53 ` marxin at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-03-02  7:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

* [Bug fortran/99326] [9/10/11 Regression] ICE in gfc_build_dummy_array_decl, at fortran/trans-decl.c:1299
  2021-03-01 17:09 [Bug fortran/99326] New: [9/10/11 Regression] ICE in gfc_build_dummy_array_decl, at fortran/trans-decl.c:1299 gscfq@t-online.de
  2021-03-02  7:44 ` [Bug fortran/99326] " rguenth at gcc dot gnu.org
@ 2021-03-02  9:53 ` marxin at gcc dot gnu.org
  2021-03-02 11:39 ` burnus at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-03-02  9:53 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-03-02
             Status|UNCONFIRMED                 |NEW
                 CC|                            |burnus at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org,
                   |                            |pault at gcc dot gnu.org

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Confirmed, started with r9-3467-ge60f68ec460bc5b3.

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

* [Bug fortran/99326] [9/10/11 Regression] ICE in gfc_build_dummy_array_decl, at fortran/trans-decl.c:1299
  2021-03-01 17:09 [Bug fortran/99326] New: [9/10/11 Regression] ICE in gfc_build_dummy_array_decl, at fortran/trans-decl.c:1299 gscfq@t-online.de
  2021-03-02  7:44 ` [Bug fortran/99326] " rguenth at gcc dot gnu.org
  2021-03-02  9:53 ` marxin at gcc dot gnu.org
@ 2021-03-02 11:39 ` burnus at gcc dot gnu.org
  2021-06-01  8:19 ` [Bug fortran/99326] [9/10/11/12 " rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-03-02 11:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> ---
This looks very much like an error I looked at before.
I think that was for 'select rank (y => x)', which
has the same issue as 'select type (y => x)' or
as this PR shows 'associate (y=>x)'.


Additionally, the following points to the 'x' (gfc_current_location)
and not to 'y'; we should save that location for the error message:

11 |       associate (y => x)
   |                       1
Error: Assumed shape array at (1) must be a dummy argument

That's something we should fix in match.c, where we have:
      if (gfc_match (" %n =>", newAssoc->name) != MATCH_YES)
...
      if (gfc_match (" %e", &newAssoc->target) 
...
      newAssoc->where = gfc_current_locus;

for associate but likewise for select type/rank.

 * * * 

In resolve.c, there is:
      if (((as->type == AS_ASSUMED_SIZE && !as->cp_was_assumed)
           || as->type == AS_ASSUMED_SHAPE)
          && !sym->attr.dummy && !sym->attr.select_type_temporary)

the latter is set for both select type + select rank. Looks as if we also need
a check like:
   sym->assoc
or something like that.

We probably should audit all code which uses select_type_temporary or
sym->assoc to see whether we need to add a condition for associate or select
type/rank there as well.

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

* [Bug fortran/99326] [9/10/11/12 Regression] ICE in gfc_build_dummy_array_decl, at fortran/trans-decl.c:1299
  2021-03-01 17:09 [Bug fortran/99326] New: [9/10/11 Regression] ICE in gfc_build_dummy_array_decl, at fortran/trans-decl.c:1299 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2021-03-02 11:39 ` burnus at gcc dot gnu.org
@ 2021-06-01  8:19 ` rguenth at gcc dot gnu.org
  2022-05-27  9:44 ` [Bug fortran/99326] [10/11/12/13 " rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-01  8:19 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.4                         |9.5

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9.4 is being released, retargeting bugs to GCC 9.5.

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

* [Bug fortran/99326] [10/11/12/13 Regression] ICE in gfc_build_dummy_array_decl, at fortran/trans-decl.c:1299
  2021-03-01 17:09 [Bug fortran/99326] New: [9/10/11 Regression] ICE in gfc_build_dummy_array_decl, at fortran/trans-decl.c:1299 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2021-06-01  8:19 ` [Bug fortran/99326] [9/10/11/12 " rguenth at gcc dot gnu.org
@ 2022-05-27  9:44 ` rguenth at gcc dot gnu.org
  2022-06-28 10:43 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-27  9:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.5                         |10.4

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9 branch is being closed

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

* [Bug fortran/99326] [10/11/12/13 Regression] ICE in gfc_build_dummy_array_decl, at fortran/trans-decl.c:1299
  2021-03-01 17:09 [Bug fortran/99326] New: [9/10/11 Regression] ICE in gfc_build_dummy_array_decl, at fortran/trans-decl.c:1299 gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2022-05-27  9:44 ` [Bug fortran/99326] [10/11/12/13 " rguenth at gcc dot gnu.org
@ 2022-06-28 10:43 ` jakub at gcc dot gnu.org
  2023-06-02  7:42 ` [Bug fortran/99326] [10/11/12/13/14 " cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-06-28 10:43 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.4                        |10.5

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 10.4 is being released, retargeting bugs to GCC 10.5.

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

* [Bug fortran/99326] [10/11/12/13/14 Regression] ICE in gfc_build_dummy_array_decl, at fortran/trans-decl.c:1299
  2021-03-01 17:09 [Bug fortran/99326] New: [9/10/11 Regression] ICE in gfc_build_dummy_array_decl, at fortran/trans-decl.c:1299 gscfq@t-online.de
                   ` (5 preceding siblings ...)
  2022-06-28 10:43 ` jakub at gcc dot gnu.org
@ 2023-06-02  7:42 ` cvs-commit at gcc dot gnu.org
  2023-06-02  8:28 ` pault at gcc dot gnu.org
  2023-08-27  8:51 ` cvs-commit at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-06-02  7:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Paul Thomas <pault@gcc.gnu.org>:

https://gcc.gnu.org/g:3c2eba4b7a2355ed5099e35332388206c484744d

commit r14-1487-g3c2eba4b7a2355ed5099e35332388206c484744d
Author: Paul Thomas <pault@gcc.gnu.org>
Date:   Fri Jun 2 08:41:45 2023 +0100

    Fortran: Fix some problems blocking associate meta-bug [PR87477]

    2023-06-02  Paul Thomas  <pault@gcc.gnu.org>

    gcc/fortran
            PR fortran/87477
            * parse.cc (parse_associate): Replace the existing evaluation
            of the target rank with calls to gfc_resolve_ref and
            gfc_expression_rank. Identify untyped target function results
            with structure constructors by finding the appropriate derived
            type.
            * resolve.cc (resolve_symbol): Allow associate variables to be
            assumed shape.

    gcc/testsuite/
            PR fortran/87477
            * gfortran.dg/associate_54.f90 : Cope with extra error.

            PR fortran/102109
            * gfortran.dg/pr102109.f90 : New test.

            PR fortran/102112
            * gfortran.dg/pr102112.f90 : New test.

            PR fortran/102190
            * gfortran.dg/pr102190.f90 : New test.

            PR fortran/102532
            * gfortran.dg/pr102532.f90 : New test.

            PR fortran/109948
            * gfortran.dg/pr109948.f90 : New test.

            PR fortran/99326
            * gfortran.dg/pr99326.f90 : New test.

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

* [Bug fortran/99326] [10/11/12/13/14 Regression] ICE in gfc_build_dummy_array_decl, at fortran/trans-decl.c:1299
  2021-03-01 17:09 [Bug fortran/99326] New: [9/10/11 Regression] ICE in gfc_build_dummy_array_decl, at fortran/trans-decl.c:1299 gscfq@t-online.de
                   ` (6 preceding siblings ...)
  2023-06-02  7:42 ` [Bug fortran/99326] [10/11/12/13/14 " cvs-commit at gcc dot gnu.org
@ 2023-06-02  8:28 ` pault at gcc dot gnu.org
  2023-08-27  8:51 ` cvs-commit at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: pault at gcc dot gnu.org @ 2023-06-02  8:28 UTC (permalink / raw)
  To: gcc-bugs

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

Paul Thomas <pault at gcc dot gnu.org> changed:

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

--- Comment #7 from Paul Thomas <pault at gcc dot gnu.org> ---
This bug is "auto-fixed" on trunk. I will close the PR for housekeeping
purposes but will ensure that the backport of all recent associate patches do
fix this bug.

Thanks once more!

Paul

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

* [Bug fortran/99326] [10/11/12/13/14 Regression] ICE in gfc_build_dummy_array_decl, at fortran/trans-decl.c:1299
  2021-03-01 17:09 [Bug fortran/99326] New: [9/10/11 Regression] ICE in gfc_build_dummy_array_decl, at fortran/trans-decl.c:1299 gscfq@t-online.de
                   ` (7 preceding siblings ...)
  2023-06-02  8:28 ` pault at gcc dot gnu.org
@ 2023-08-27  8:51 ` cvs-commit at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-08-27  8:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Paul Thomas <pault@gcc.gnu.org>:

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

commit r13-7761-gd6997a5aab7aaa325946a6283bfee8ac2bd9f540
Author: Paul Thomas <pault@gcc.gnu.org>
Date:   Sun Aug 27 09:51:32 2023 +0100

    Fortran: Fix some problems blocking associate meta-bug [PR87477]

    2023-08-27  Paul Thomas  <pault@gcc.gnu.org>

    gcc/fortran
            PR fortran/87477
            * parse.cc (parse_associate): Replace the existing evaluation
            of the target rank with calls to gfc_resolve_ref and
            gfc_expression_rank. Identify untyped target function results
            with structure constructors by finding the appropriate derived
            type.
            * resolve.cc (resolve_symbol): Allow associate variables to be
            assumed shape.

    gcc/testsuite/
            PR fortran/87477
            * gfortran.dg/associate_54.f90 : Cope with extra error.

            PR fortran/102109
            * gfortran.dg/pr102109.f90 : New test.

            PR fortran/102112
            * gfortran.dg/pr102112.f90 : New test.

            PR fortran/102190
            * gfortran.dg/pr102190.f90 : New test.

            PR fortran/102532
            * gfortran.dg/pr102532.f90 : New test.

            PR fortran/109948
            * gfortran.dg/pr109948.f90 : New test.

            PR fortran/99326
            * gfortran.dg/pr99326.f90 : New test.

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

end of thread, other threads:[~2023-08-27  8:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-01 17:09 [Bug fortran/99326] New: [9/10/11 Regression] ICE in gfc_build_dummy_array_decl, at fortran/trans-decl.c:1299 gscfq@t-online.de
2021-03-02  7:44 ` [Bug fortran/99326] " rguenth at gcc dot gnu.org
2021-03-02  9:53 ` marxin at gcc dot gnu.org
2021-03-02 11:39 ` burnus at gcc dot gnu.org
2021-06-01  8:19 ` [Bug fortran/99326] [9/10/11/12 " rguenth at gcc dot gnu.org
2022-05-27  9:44 ` [Bug fortran/99326] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:43 ` jakub at gcc dot gnu.org
2023-06-02  7:42 ` [Bug fortran/99326] [10/11/12/13/14 " cvs-commit at gcc dot gnu.org
2023-06-02  8:28 ` pault at gcc dot gnu.org
2023-08-27  8:51 ` 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).