public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/95587] New: ICE in gfc_target_encode_expr, at fortran/target-memory.c:362
@ 2020-06-08 18:56 gscfq@t-online.de
  2020-06-08 22:03 ` [Bug fortran/95587] " dominiq at lps dot ens.fr
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: gscfq@t-online.de @ 2020-06-08 18:56 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95587
           Summary: ICE in gfc_target_encode_expr, at
                    fortran/target-memory.c:362
           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
   class(*), allocatable :: x, y
   equivalence (x, y)
end


$ cat z2.f90
program p
   type t
   end type
   class(t), allocatable :: x, y
   equivalence (x, y)
end


$ cat z0.f90   # ok, allocatable object or pointer not allowed
program p
   type t
   end type
   type(t), allocatable :: x, y
   equivalence (x, y)
end


$ gfortran-11-20200607 -c z1.f90
f951: internal compiler error: Invalid expression in gfc_target_encode_expr.
0x654af9 gfc_report_diagnostic
        ../../gcc/fortran/error.c:782
0x65621a gfc_internal_error(char const*, ...)
        ../../gcc/fortran/error.c:1402
0x6f3200 gfc_target_encode_expr(gfc_expr*, unsigned char*, unsigned long)
        ../../gcc/fortran/target-memory.c:362
0x6f32ff expr_to_char
        ../../gcc/fortran/target-memory.c:697
0x6f3dd0 gfc_merge_initializers(gfc_typespec, gfc_expr*, locus*, unsigned
char*, unsigned char*, unsigned long)
        ../../gcc/fortran/target-memory.c:735
0x71cc63 get_init_field
        ../../gcc/fortran/trans-common.c:544
0x71cc63 create_common
        ../../gcc/fortran/trans-common.c:633
0x71e111 finish_equivalences
        ../../gcc/fortran/trans-common.c:1326
0x71e111 gfc_trans_common(gfc_namespace*)
        ../../gcc/fortran/trans-common.c:1363
0x72b60f gfc_generate_function_code(gfc_namespace*)
        ../../gcc/fortran/trans-decl.c:6764
0x6b3126 translate_all_program_units
        ../../gcc/fortran/parse.c:6306
0x6b3126 gfc_parse_file()
        ../../gcc/fortran/parse.c:6545
0x6feb3f gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:212

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

* [Bug fortran/95587] ICE in gfc_target_encode_expr, at fortran/target-memory.c:362
  2020-06-08 18:56 [Bug fortran/95587] New: ICE in gfc_target_encode_expr, at fortran/target-memory.c:362 gscfq@t-online.de
@ 2020-06-08 22:03 ` dominiq at lps dot ens.fr
  2020-06-18 20:40 ` anlauf at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dominiq at lps dot ens.fr @ 2020-06-08 22:03 UTC (permalink / raw)
  To: gcc-bugs

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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2020-06-08
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Confirmed.

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

* [Bug fortran/95587] ICE in gfc_target_encode_expr, at fortran/target-memory.c:362
  2020-06-08 18:56 [Bug fortran/95587] New: ICE in gfc_target_encode_expr, at fortran/target-memory.c:362 gscfq@t-online.de
  2020-06-08 22:03 ` [Bug fortran/95587] " dominiq at lps dot ens.fr
@ 2020-06-18 20:40 ` anlauf at gcc dot gnu.org
  2020-06-18 21:28 ` anlauf at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-06-18 20:40 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anlauf at gcc dot gnu.org
           Priority|P3                          |P4

--- Comment #2 from anlauf at gcc dot gnu.org ---
The ICE is fixed by this patch:

diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index 82d2b5087e5..8063fcad295 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -5700,6 +5700,11 @@ gfc_match_equivalence (void)

          if (!gfc_add_in_equivalence (&sym->attr, sym->name, NULL))
            goto cleanup;
+         if (sym->ts.type == BT_CLASS
+             && CLASS_DATA (sym)
+             && !gfc_add_in_equivalence (&CLASS_DATA (sym)->attr,
+                                         sym->name, NULL))
+           goto cleanup;

          if (sym->attr.in_common)
            {

Haven't tested this thoroughly yet.

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

* [Bug fortran/95587] ICE in gfc_target_encode_expr, at fortran/target-memory.c:362
  2020-06-08 18:56 [Bug fortran/95587] New: ICE in gfc_target_encode_expr, at fortran/target-memory.c:362 gscfq@t-online.de
  2020-06-08 22:03 ` [Bug fortran/95587] " dominiq at lps dot ens.fr
  2020-06-18 20:40 ` anlauf at gcc dot gnu.org
@ 2020-06-18 21:28 ` anlauf at gcc dot gnu.org
  2020-06-20 14:05 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-06-18 21:28 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |anlauf at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

--- Comment #3 from anlauf at gcc dot gnu.org ---
Regtests cleanly.  Submitted for review:

https://gcc.gnu.org/pipermail/fortran/2020-June/054554.html

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

* [Bug fortran/95587] ICE in gfc_target_encode_expr, at fortran/target-memory.c:362
  2020-06-08 18:56 [Bug fortran/95587] New: ICE in gfc_target_encode_expr, at fortran/target-memory.c:362 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2020-06-18 21:28 ` anlauf at gcc dot gnu.org
@ 2020-06-20 14:05 ` cvs-commit at gcc dot gnu.org
  2020-06-22 19:27 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-20 14:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:5eb947601bdce59f2ff26694327ad173c51c2724

commit r11-1566-g5eb947601bdce59f2ff26694327ad173c51c2724
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Sat Jun 20 16:05:13 2020 +0200

    PR fortran/95587 - ICE in gfc_target_encode_expr, at
fortran/target-memory.c:362

    EQUIVALENCE objects are subject to constraints listed in the Fortran 2018
    standard, section 8.10.1.1.  These constraints are to be checked
    also for CLASS variables.

    gcc/fortran/
            PR fortran/95587
            * match.c (gfc_match_equivalence): Check constraints on
            EQUIVALENCE objects also for CLASS variables.

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

* [Bug fortran/95587] ICE in gfc_target_encode_expr, at fortran/target-memory.c:362
  2020-06-08 18:56 [Bug fortran/95587] New: ICE in gfc_target_encode_expr, at fortran/target-memory.c:362 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2020-06-20 14:05 ` cvs-commit at gcc dot gnu.org
@ 2020-06-22 19:27 ` cvs-commit at gcc dot gnu.org
  2020-06-23 20:18 ` cvs-commit at gcc dot gnu.org
  2020-06-23 20:32 ` anlauf at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-22 19:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:

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

commit r10-8337-gc00ca04ba7e46d2d59e5a4f95ee7121cdc4ba224
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Sat Jun 20 16:05:13 2020 +0200

    PR fortran/95587 - ICE in gfc_target_encode_expr, at
fortran/target-memory.c:362

    EQUIVALENCE objects are subject to constraints listed in the Fortran 2018
    standard, section 8.10.1.1.  These constraints are to be checked
    also for CLASS variables.

    gcc/fortran/
            PR fortran/95587
            * match.c (gfc_match_equivalence): Check constraints on
            EQUIVALENCE objects also for CLASS variables.

    (cherry picked from commit 5eb947601bdce59f2ff26694327ad173c51c2724)

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

* [Bug fortran/95587] ICE in gfc_target_encode_expr, at fortran/target-memory.c:362
  2020-06-08 18:56 [Bug fortran/95587] New: ICE in gfc_target_encode_expr, at fortran/target-memory.c:362 gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2020-06-22 19:27 ` cvs-commit at gcc dot gnu.org
@ 2020-06-23 20:18 ` cvs-commit at gcc dot gnu.org
  2020-06-23 20:32 ` anlauf at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-23 20:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:

https://gcc.gnu.org/g:449246af10befa7e973cd6f864138e6cdd5c24e5

commit r9-8692-g449246af10befa7e973cd6f864138e6cdd5c24e5
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Sat Jun 20 16:05:13 2020 +0200

    PR fortran/95587 - ICE in gfc_target_encode_expr, at
fortran/target-memory.c:362

    EQUIVALENCE objects are subject to constraints listed in the Fortran 2018
    standard, section 8.10.1.1.  These constraints are to be checked
    also for CLASS variables.

    gcc/fortran/
            PR fortran/95587
            * match.c (gfc_match_equivalence): Check constraints on
            EQUIVALENCE objects also for CLASS variables.

    (cherry picked from commit 5eb947601bdce59f2ff26694327ad173c51c2724)

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

* [Bug fortran/95587] ICE in gfc_target_encode_expr, at fortran/target-memory.c:362
  2020-06-08 18:56 [Bug fortran/95587] New: ICE in gfc_target_encode_expr, at fortran/target-memory.c:362 gscfq@t-online.de
                   ` (5 preceding siblings ...)
  2020-06-23 20:18 ` cvs-commit at gcc dot gnu.org
@ 2020-06-23 20:32 ` anlauf at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-06-23 20:32 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

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

--- Comment #7 from anlauf at gcc dot gnu.org ---
Fixed on master for GCC-11, and backported to 10-branch and 9-branch. Closing.

Thanks for the report!

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

end of thread, other threads:[~2020-06-23 20:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-08 18:56 [Bug fortran/95587] New: ICE in gfc_target_encode_expr, at fortran/target-memory.c:362 gscfq@t-online.de
2020-06-08 22:03 ` [Bug fortran/95587] " dominiq at lps dot ens.fr
2020-06-18 20:40 ` anlauf at gcc dot gnu.org
2020-06-18 21:28 ` anlauf at gcc dot gnu.org
2020-06-20 14:05 ` cvs-commit at gcc dot gnu.org
2020-06-22 19:27 ` cvs-commit at gcc dot gnu.org
2020-06-23 20:18 ` cvs-commit at gcc dot gnu.org
2020-06-23 20:32 ` anlauf 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).