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

--- Comment #7 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> May be a duplicate of or similar to pr78983.

While the patch at https://gcc.gnu.org/ml/fortran/2017-12/msg00099.html fixes
pr78983 (AFAICT), this PR is only partially fixed by the patch

% gfc -c pr80235_a.f90 -fcoarray=lib -lcaf_single
% gfc pr80235_b_red.f90 pr80235_a.o -fcoarray=lib -lcaf_single
pr80235_b_red.f90:16:0:

 maxfe = size( cgca_pfem_centroid_tmp%r, dim=2 )

The backtrace is

 cgca_pfem_mapProcess 14730 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS
(code=1, address=0x10)
    frame #0: 0x000000010010e75c
f951`gfc_module_add_decl(entry=0x0000000000000000, decl=0x0000000142e20d80) at
trans-decl.c:4826
   4823       name = IDENTIFIER_POINTER (TYPE_NAME (TREE_TYPE (decl)));
   4824     }
   4825   tree *slot
-> 4826     = entry->decls->find_slot_with_hash (name, htab_hash_string (name),
   4827                                          INSERT);
   4828   if (*slot == NULL)
   4829     *slot = decl;
Target 0: (f951) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS
(code=1, address=0x10)
  * frame #0: 0x000000010010e75c
f951`gfc_module_add_decl(entry=0x0000000000000000, decl=0x0000000142e20d80) at
trans-decl.c:4826
    frame #1: 0x000000010010f415
f951`::gfc_build_qualified_array(decl=<unavailable>, sym=0x0000000142f148d0) at
trans-decl.c:976
    frame #2: 0x000000010011183d
f951`gfc_get_symbol_decl(sym=0x0000000142f148d0) at trans-decl.c:1742
    frame #3: 0x0000000100127888
f951`::gfc_conv_variable(se=0x00007ffeefbfe1f0, expr=0x0000000142f0be60) at
trans-expr.c:2506
    frame #4: 0x00000001001237bb f951`gfc_conv_expr(se=0x00007ffeefbfe1f0,
expr=0x0000000142f0be60) at trans-expr.c:7872
    frame #5: 0x0000000100126951 f951`gfc_conv_expr_lhs(se=0x00007ffeefbfe1f0,
expr=0x0000000142f0be60) at trans-expr.c:7902
    frame #6: 0x00000001000f10ce
f951`::gfc_conv_ss_descriptor(block=0x00007ffeefbfe5f0, base=0,
ss=<unavailable>) at trans-array.c:2854
    frame #7: 0x000000010010007e
f951`gfc_conv_expr_descriptor(se=0x00007ffeefbfe5f0, expr=0x0000000142f0be60)
at trans-array.c:7026
    frame #8: 0x00000001001322a1
f951`::gfc_conv_intrinsic_size(se=0x00007ffeefbfea60, expr=0x0000000142f0bd80)
at trans-intrinsic.c:6670
    frame #9: 0x000000010014966d
f951`gfc_conv_intrinsic_function(se=0x00007ffeefbfea60,
expr=0x0000000142f0bd80) at trans-intrinsic.c:9151
    frame #10: 0x000000010012379b f951`gfc_conv_expr(se=0x00007ffeefbfea60,
expr=0x0000000142f0bd80) at trans-expr.c:7864
    frame #11: 0x000000010012c9a6
f951`::gfc_trans_assignment_1(expr1=0x0000000142f0b480,
expr2=0x0000000142f0bd80, init_flag=<unavailable>, dealloc=<unavailable>,
use_vptr_copy=false, may_alias=<unavailable>) at trans-expr.c:10032
    frame #12: 0x00000001000e7688 f951`::trans_code(code=0x0000000142f229b0,
cond=0x0000000000000000) at trans.c:1828
    frame #13: 0x00000001001158a3
f951`gfc_generate_function_code(ns=<unavailable>) at trans-decl.c:6443
    frame #14: 0x00000001000ec2c2
f951`gfc_generate_module_code(ns=0x000000014300a800) at trans.c:2206
    frame #15: 0x000000010009a148 f951`gfc_parse_file() at parse.c:6090
    frame #16: 0x000000010009a0a3 f951`gfc_parse_file()
    frame #17: 0x00000001000e39ec f951`::gfc_be_parse_file() at f95-lang.c:204
    frame #18: 0x0000000100ba49fa f951`::compile_file() at toplev.c:455
    frame #19: 0x000000010123fb04 f951`toplev::main(int, char**) + 2244
    frame #20: 0x000000010124164e f951`main + 46
    frame #21: 0x00007fff59335115 libdyld.dylib`start + 1
    frame #22: 0x00007fff59335115 libdyld.dylib`start + 1
(lldb) p *name
(const char) $4 = '\n'

Reply via email to