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

--- Comment #13 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
The following variant gives an ICE

   type t
   end type
contains
   function f() result(t)
      character(3) :: c
      c = 'abc'
   end
end

The back trace is

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS
(code=1, address=0x0)
  * frame #0: 0x00007fff206945d2 libsystem_platform.dylib`_platform_strlen + 18
    frame #1: 0x0000000100e99509 f951`get_identifier(text=0x0000000000000000)
at stringpool.c:95:32
    frame #2: 0x000000010012b302 f951`::build_function_decl(gfc_symbol *, bool)
[inlined] gfc_sym_identifier(sym=<unavailable>) at trans-decl.c:366:10
    frame #3: 0x000000010012b2d5
f951`::build_function_decl(sym=0x000000014331e0b0, global=<unavailable>)
    frame #4: 0x0000000100139a3b
f951`gfc_generate_function_code(gfc_namespace*) [inlined]
gfc_create_function_decl(global=<unavailable>, ns=0x000000014403da00) at
trans-decl.c:3082:23
    frame #5: 0x0000000100139a2d
f951`gfc_generate_function_code(gfc_namespace*) [inlined]
gfc_generate_contained_functions(parent=0x0000000144038e00)
    frame #6: 0x0000000100139a03
f951`gfc_generate_function_code(ns=0x0000000144038e00)
    frame #7: 0x00000001000b04c4 f951`gfc_parse_file() at parse.c:6354:25
    frame #8: 0x00000001001049bc f951`::gfc_be_parse_file() at
f95-lang.c:212:18
    frame #9: 0x0000000100ea0264 f951`::compile_file() at toplev.c:457:25
    frame #10: 0x00000001016597cf f951`toplev::main(int, char**) at
toplev.c:2201:24
    frame #11: 0x000000010165948e f951`toplev::main(this=0x00007ffeefbff09e,
argc=<unavailable>, argv=<unavailable>)
    frame #12: 0x000000010165b9e1 f951`main(argc=2, argv=0x00007ffeefbff0d8) at
main.c:39:22

Is the code valid?

Reply via email to