public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/105379] New: [12 Regression] ICE in gfc_compare_array_spec(): Array spec clobbered
@ 2022-04-25 16:13 gscfq@t-online.de
  2022-04-25 18:08 ` [Bug fortran/105379] " mikael at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: gscfq@t-online.de @ 2022-04-25 16:13 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105379
           Summary: [12 Regression] ICE in gfc_compare_array_spec(): Array
                    spec clobbered
           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: ---

Started between 20220417 and 20220424 :


$ cat z1.f90
program p
   type t
   end type
contains
   subroutine s1(x)
      class(t) :: x(3)
   end
   subroutine s2(n, x)
      integer :: n
      class(t) :: x(n)
   end
end


$ cat z2.f90
program p
   type t
   end type
   integer :: m = 3
contains
   subroutine s1(x)
      class(t) :: x(3)
   end
   subroutine s3(x)
      class(t) :: x(m)
   end
end


$ gfortran-12-20220424 -c z1.f90
f951: internal compiler error: gfc_compare_array_spec(): Array spec clobbered
0x6f15b9 gfc_report_diagnostic
        ../../gcc/fortran/error.cc:883
0x6f3137 gfc_internal_error(char const*, ...)
        ../../gcc/fortran/error.cc:1503
0x6be47f compare_bounds
        ../../gcc/fortran/array.cc:971
0x6bfde3 gfc_compare_array_spec(gfc_array_spec*, gfc_array_spec*)
        ../../gcc/fortran/array.cc:1012
0x6ff3dc compare_components
        ../../gcc/fortran/interface.cc:495
0x6ff6d0 gfc_compare_derived_types(gfc_symbol*, gfc_symbol*)
        ../../gcc/fortran/interface.cc:678
0x834de8 gfc_copy_dt_decls_ifequal(gfc_symbol*, gfc_symbol*, bool)
        ../../gcc/fortran/trans-types.cc:2453
0x8342c4 gfc_get_derived_type(gfc_symbol*, int)
        ../../gcc/fortran/trans-types.cc:2922
0x834d18 gfc_typenode_for_spec(gfc_typespec*, int)
        ../../gcc/fortran/trans-types.cc:1195
0x834f78 gfc_sym_type(gfc_symbol*, bool)
        ../../gcc/fortran/trans-types.cc:2307
0x83344f gfc_get_function_type(gfc_symbol*, gfc_actual_arglist*, char const*)
        ../../gcc/fortran/trans-types.cc:3161
0x7c7424 build_function_decl
        ../../gcc/fortran/trans-decl.cc:2393
0x7cf3a6 gfc_create_function_decl(gfc_namespace*, bool)
        ../../gcc/fortran/trans-decl.cc:3102
0x7d48be gfc_generate_contained_functions
        ../../gcc/fortran/trans-decl.cc:5768
0x7d48be gfc_generate_function_code(gfc_namespace*)
        ../../gcc/fortran/trans-decl.cc:7586
0x75700e translate_all_program_units
        ../../gcc/fortran/parse.cc:6669
0x75700e gfc_parse_file()
        ../../gcc/fortran/parse.cc:6956
0x7a44af gfc_be_parse_file
        ../../gcc/fortran/f95-lang.cc:216

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

* [Bug fortran/105379] [12 Regression] ICE in gfc_compare_array_spec(): Array spec clobbered
  2022-04-25 16:13 [Bug fortran/105379] New: [12 Regression] ICE in gfc_compare_array_spec(): Array spec clobbered gscfq@t-online.de
@ 2022-04-25 18:08 ` mikael at gcc dot gnu.org
  2022-04-25 20:35 ` [Bug fortran/105379] [12 Regression] ICE in gfc_compare_array_spec(): Array spec clobbered since r12-8235-gfa5cd7102da676dc marxin at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mikael at gcc dot gnu.org @ 2022-04-25 18:08 UTC (permalink / raw)
  To: gcc-bugs

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

Mikael Morin <mikael at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED
                 CC|                            |mikael at gcc dot gnu.org
   Last reconfirmed|                            |2022-04-25

--- Comment #1 from Mikael Morin <mikael at gcc dot gnu.org> ---
Caused by r12-8235-gfa5cd7102da676dcb1757b1288421f5f3439ae0e, I guess.
So I am the culprit.

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

* [Bug fortran/105379] [12 Regression] ICE in gfc_compare_array_spec(): Array spec clobbered since r12-8235-gfa5cd7102da676dc
  2022-04-25 16:13 [Bug fortran/105379] New: [12 Regression] ICE in gfc_compare_array_spec(): Array spec clobbered gscfq@t-online.de
  2022-04-25 18:08 ` [Bug fortran/105379] " mikael at gcc dot gnu.org
@ 2022-04-25 20:35 ` marxin at gcc dot gnu.org
  2022-04-25 21:18 ` mikael at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-04-25 20:35 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marxin at gcc dot gnu.org
            Summary|[12 Regression] ICE in      |[12 Regression] ICE in
                   |gfc_compare_array_spec():   |gfc_compare_array_spec():
                   |Array spec clobbered        |Array spec clobbered since
                   |                            |r12-8235-gfa5cd7102da676dc

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Mikael Morin from comment #1)
> Caused by r12-8235-gfa5cd7102da676dcb1757b1288421f5f3439ae0e, I guess.
> So I am the culprit.

Yes, I can confirm that.

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

* [Bug fortran/105379] [12 Regression] ICE in gfc_compare_array_spec(): Array spec clobbered since r12-8235-gfa5cd7102da676dc
  2022-04-25 16:13 [Bug fortran/105379] New: [12 Regression] ICE in gfc_compare_array_spec(): Array spec clobbered gscfq@t-online.de
  2022-04-25 18:08 ` [Bug fortran/105379] " mikael at gcc dot gnu.org
  2022-04-25 20:35 ` [Bug fortran/105379] [12 Regression] ICE in gfc_compare_array_spec(): Array spec clobbered since r12-8235-gfa5cd7102da676dc marxin at gcc dot gnu.org
@ 2022-04-25 21:18 ` mikael at gcc dot gnu.org
  2022-04-26  6:48 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mikael at gcc dot gnu.org @ 2022-04-25 21:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Mikael Morin <mikael at gcc dot gnu.org> ---
Created attachment 52876
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52876&action=edit
Draft patch

This shows no testsuite regression.
But there is something that I want to check before submitting it tomorrow.

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

* [Bug fortran/105379] [12 Regression] ICE in gfc_compare_array_spec(): Array spec clobbered since r12-8235-gfa5cd7102da676dc
  2022-04-25 16:13 [Bug fortran/105379] New: [12 Regression] ICE in gfc_compare_array_spec(): Array spec clobbered gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2022-04-25 21:18 ` mikael at gcc dot gnu.org
@ 2022-04-26  6:48 ` rguenth at gcc dot gnu.org
  2022-04-26  8:33 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-04-26  6:48 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0

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

* [Bug fortran/105379] [12 Regression] ICE in gfc_compare_array_spec(): Array spec clobbered since r12-8235-gfa5cd7102da676dc
  2022-04-25 16:13 [Bug fortran/105379] New: [12 Regression] ICE in gfc_compare_array_spec(): Array spec clobbered gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2022-04-26  6:48 ` rguenth at gcc dot gnu.org
@ 2022-04-26  8:33 ` rguenth at gcc dot gnu.org
  2022-04-27  9:36 ` cvs-commit at gcc dot gnu.org
  2022-04-27  9:39 ` rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-04-26  8:33 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1

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

* [Bug fortran/105379] [12 Regression] ICE in gfc_compare_array_spec(): Array spec clobbered since r12-8235-gfa5cd7102da676dc
  2022-04-25 16:13 [Bug fortran/105379] New: [12 Regression] ICE in gfc_compare_array_spec(): Array spec clobbered gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2022-04-26  8:33 ` rguenth at gcc dot gnu.org
@ 2022-04-27  9:36 ` cvs-commit at gcc dot gnu.org
  2022-04-27  9:39 ` rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-04-27  9:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Mikael Morin <mikael@gcc.gnu.org>:

https://gcc.gnu.org/g:6a460a2007dd9c527c5f9d5bbbedb852db7c1373

commit r12-8281-g6a460a2007dd9c527c5f9d5bbbedb852db7c1373
Author: Mikael Morin <mikael@gcc.gnu.org>
Date:   Wed Apr 27 11:36:16 2022 +0200

    fortran: Compare non-constant bound expressions. [PR105379]

    Starting with r12-8235-gfa5cd7102da676dcb1757b1288421f5f3439ae0e,
    class descriptor types are compared to detect duplicate declarations.

    This caused ICEs as the comparison of array spec supported only constant
    explicit bounds, but dummy class variable descriptor types can have a
    _data field with non-constant array spec bounds.

    This change adds support for non-constant bounds.  For that,
    gfc_dep_compare_expr is used.  It does probably more than strictly
    necessary, but using it avoids rewriting a specific comparison function,
    making mistakes and forgetting cases.

            PR fortran/103662
            PR fortran/105379

    gcc/fortran/ChangeLog:

            * array.cc (compare_bounds): Use bool as return type.
            Support non-constant expressions.
            (gfc_compare_array_spec): Update call to compare_bounds.

    gcc/testsuite/ChangeLog:

            * gfortran.dg/class_dummy_8.f90: New test.
            * gfortran.dg/class_dummy_9.f90: New test.

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

* [Bug fortran/105379] [12 Regression] ICE in gfc_compare_array_spec(): Array spec clobbered since r12-8235-gfa5cd7102da676dc
  2022-04-25 16:13 [Bug fortran/105379] New: [12 Regression] ICE in gfc_compare_array_spec(): Array spec clobbered gscfq@t-online.de
                   ` (5 preceding siblings ...)
  2022-04-27  9:36 ` cvs-commit at gcc dot gnu.org
@ 2022-04-27  9:39 ` rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-04-27  9:39 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Thanks.

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

end of thread, other threads:[~2022-04-27  9:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-25 16:13 [Bug fortran/105379] New: [12 Regression] ICE in gfc_compare_array_spec(): Array spec clobbered gscfq@t-online.de
2022-04-25 18:08 ` [Bug fortran/105379] " mikael at gcc dot gnu.org
2022-04-25 20:35 ` [Bug fortran/105379] [12 Regression] ICE in gfc_compare_array_spec(): Array spec clobbered since r12-8235-gfa5cd7102da676dc marxin at gcc dot gnu.org
2022-04-25 21:18 ` mikael at gcc dot gnu.org
2022-04-26  6:48 ` rguenth at gcc dot gnu.org
2022-04-26  8:33 ` rguenth at gcc dot gnu.org
2022-04-27  9:36 ` cvs-commit at gcc dot gnu.org
2022-04-27  9:39 ` rguenth 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).