public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/98023] New: ICE: free_expr0(): Bad expr type
@ 2020-11-27  3:38 asolokha at gmx dot com
  2020-11-27  4:29 ` [Bug fortran/98023] " kargl at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: asolokha at gmx dot com @ 2020-11-27  3:38 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98023
           Summary: ICE: free_expr0(): Bad expr type
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

gfortran-11.0.0-alpha20201122 snapshot
(g:e23f47ec4065e9eec53c4ad9db91bc36a4f90793) ICEs when compiling the following
testcase reduced from test/Semantics/resolve92.f90 from the flang 11.0.0 test
suite:

module x1
  type :: ww(fz)
     integer, kind :: fz
  end type ww
  type :: ky(ww)
     integer, kind :: ww
     type(ww(fz)) :: ke = ww(fz)
  end type ky
end module x1

% powerpc-e300c3-linux-gnu-gfortran-11.0.0 -c txoboesk.f90
f951: internal compiler error: free_expr0(): Bad expr type
0x7fdb7a gfc_report_diagnostic
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/fortran/error.c:782
0x7fdb7a gfc_internal_error(char const*, ...)
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/fortran/error.c:1402
0x7fe7ce free_expr0
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/fortran/expr.c:509
0x7fe7dd gfc_free_expr(gfc_expr*)
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/fortran/expr.c:530
0x7fe7dd gfc_free_expr(gfc_expr*)
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/fortran/expr.c:526
0x7fe824 gfc_free_actual_arglist(gfc_actual_arglist*)
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/fortran/expr.c:546
0x7eeb9c gfc_match_data_decl()
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/fortran/decl.c:6246
0x85d0d9 match_word
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/fortran/parse.c:65
0x85d0d9 decode_statement
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/fortran/parse.c:376
0x862524 next_free
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/fortran/parse.c:1315
0x862524 next_statement
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/fortran/parse.c:1547
0x864934 parse_derived
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/fortran/parse.c:3383
0x864934 parse_spec
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/fortran/parse.c:3924
0x867b56 parse_module
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/fortran/parse.c:6156
0x868122 gfc_parse_file()
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/fortran/parse.c:6469
0x8bddbe gfc_be_parse_file
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/fortran/f95-lang.c:212

(While my target here is powerpc, the ICE is not target-dependent.)

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

* [Bug fortran/98023] ICE: free_expr0(): Bad expr type
  2020-11-27  3:38 [Bug fortran/98023] New: ICE: free_expr0(): Bad expr type asolokha at gmx dot com
@ 2020-11-27  4:29 ` kargl at gcc dot gnu.org
  2020-11-27 11:22 ` marxin at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: kargl at gcc dot gnu.org @ 2020-11-27  4:29 UTC (permalink / raw)
  To: gcc-bugs

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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #1 from kargl at gcc dot gnu.org ---
Bandage.


Index: gcc/gcc/fortran/expr.c
===================================================================
--- gcc/gcc/fortran/expr.c      (revision 280157)
+++ gcc/gcc/fortran/expr.c      (working copy)
@@ -525,7 +525,7 @@ free_expr0 (gfc_expr *e)
 void
 gfc_free_expr (gfc_expr *e)
 {
-  if (e == NULL)
+  if (e == NULL || e->expr_type == EXPR_UNKNOWN)
     return;
   free_expr0 (e);
   free (e);

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

* [Bug fortran/98023] ICE: free_expr0(): Bad expr type
  2020-11-27  3:38 [Bug fortran/98023] New: ICE: free_expr0(): Bad expr type asolokha at gmx dot com
  2020-11-27  4:29 ` [Bug fortran/98023] " kargl at gcc dot gnu.org
@ 2020-11-27 11:22 ` marxin at gcc dot gnu.org
  2020-11-30 21:49 ` anlauf at gcc dot gnu.org
  2023-06-30  8:18 ` [Bug fortran/98023] ICE: [PDT] " pault at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-11-27 11:22 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-11-27
                 CC|                            |marxin at gcc dot gnu.org,
                   |                            |pault at gcc dot gnu.org
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Btw. started with r8-3056-g5bab4c9631c478b7.

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

* [Bug fortran/98023] ICE: free_expr0(): Bad expr type
  2020-11-27  3:38 [Bug fortran/98023] New: ICE: free_expr0(): Bad expr type asolokha at gmx dot com
  2020-11-27  4:29 ` [Bug fortran/98023] " kargl at gcc dot gnu.org
  2020-11-27 11:22 ` marxin at gcc dot gnu.org
@ 2020-11-30 21:49 ` anlauf at gcc dot gnu.org
  2023-06-30  8:18 ` [Bug fortran/98023] ICE: [PDT] " pault at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-11-30 21:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from anlauf at gcc dot gnu.org ---
The patch in comment#1 does not work for me on x86_64-pc-linux-gnu.

In decl.c:

6242    cleanup:
6243      if (saved_kind_expr)
6244        gfc_free_expr (saved_kind_expr);
6245      if (type_param_spec_list)
6246        gfc_free_actual_arglist (type_param_spec_list);

(gdb) p type_param_spec_list->expr->expr_type
$177 = 42350080

So type_param_spec_list really gets screwed up.

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

* [Bug fortran/98023] ICE: [PDT] free_expr0(): Bad expr type
  2020-11-27  3:38 [Bug fortran/98023] New: ICE: free_expr0(): Bad expr type asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2020-11-30 21:49 ` anlauf at gcc dot gnu.org
@ 2023-06-30  8:18 ` pault at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pault at gcc dot gnu.org @ 2023-06-30  8:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Paul Thomas <pault at gcc dot gnu.org> ---
Added to PDT meta-bug

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

end of thread, other threads:[~2023-06-30  8:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-27  3:38 [Bug fortran/98023] New: ICE: free_expr0(): Bad expr type asolokha at gmx dot com
2020-11-27  4:29 ` [Bug fortran/98023] " kargl at gcc dot gnu.org
2020-11-27 11:22 ` marxin at gcc dot gnu.org
2020-11-30 21:49 ` anlauf at gcc dot gnu.org
2023-06-30  8:18 ` [Bug fortran/98023] ICE: [PDT] " pault 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).