https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127273
Bug ID: 127273
Summary: [OpenMP] with 'link' clause, ICE (segfault) in
ipa_reference_var_uid /
symtab_node::ultimate_alias_target
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code, openmp
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: burnus at gcc dot gnu.org
CC: tschwinge at gcc dot gnu.org
Target Milestone: ---
Target: nvptx
This is with
libgomp/testsuite/libgomp.c/usm_env_handling-1.c
with an added
'#pragma omp requires self_maps'
It works when compiled with -O0 or on the host and AMD GCN offloading,
but fails in the nvptx lto1 with:
during GIMPLE pass: fre
libgomp/testsuite/libgomp.c/usm_env_handling-1.c: In function ‘checkA’:
libgomp/testsuite/libgomp.c/usm_env_handling-1.c:36:1: internal compiler error:
Segmentation fault
36 | checkA (int expected, int also_ok, const char *dir)
| ^
0x21aa6bf internal_error(char const*, ...)
/home/tob/repos/gcc/gcc/diagnostic-global-context.cc:787
0xfc380f crash_signal
/home/tob/repos/gcc/gcc/toplev.cc:325
0x203dca9 symtab_node::ultimate_alias_target(availability*, symtab_node*)
/home/tob/repos/gcc/gcc/cgraph.h:3568
0x203dca9 ipa_reference_var_uid(tree_node*)
/home/tob/repos/gcc/gcc/ipa-reference.cc:152
0x110cfa8 call_may_clobber_ref_p_1(gcall*, ao_ref*, bool)
/home/tob/repos/gcc/gcc/tree-ssa-alias.cc:3256
0x110d61c maybe_skip_until
/home/tob/repos/gcc/gcc/tree-ssa-alias.cc:3817
0x110d61c get_continuation_for_phi(gphi*, ao_ref*, bool, unsigned int&,
bitmap_head**, bool, void* (*)(ao_ref*, tree_node*, void*, translate_flags*),
void*, bool (*)(edge_def*, void*), translate_flags)
/home/tob/repos/gcc/gcc/tree-ssa-alias.cc:3895
0x110d8b4 walk_non_aliased_vuses(ao_ref*, tree_node*, bool, void* (*)(ao_ref*,
tree_node*, void*), void* (*)(ao_ref*, tree_node*, void*, translate_flags*),
bool (*)(edge_def*, void*), tree_node* (*)(tree_node*), unsigned int&, void*)
/home/tob/repos/gcc/gcc/tree-ssa-alias.cc:3984
In the debugger:
Breakpoint 3, ipa_reference_var_uid (t=t@entry=0x7ffff70ff1c8) at
/home/tob/repos/gcc/gcc/ipa-reference.cc:149
149 if (!ipa_reference_vars_map)
(gdb) s
152 (symtab_node::get (t)->ultimate_alias_target (NULL)->decl);
(gdb) s
symtab_node::get (decl=0x7ffff70ff1c8) at /home/tob/repos/gcc/gcc/cgraph.h:497
497 gcc_checking_assert (TREE_CODE (decl) == FUNCTION_DECL
(gdb) finish
Run till exit from #0 symtab_node::get (decl=0x7ffff70ff1c8) at
/home/tob/repos/gcc/gcc/cgraph.h:497
ipa_reference_var_uid (t=t@entry=0x7ffff70ff1c8) at
/home/tob/repos/gcc/gcc/ipa-reference.cc:152
152 (symtab_node::get (t)->ultimate_alias_target (NULL)->decl);
(gdb) s
symtab_node::ultimate_alias_target (this=0x0, availability=0x0, ref=0x0) at
/home/tob/repos/gcc/gcc/cgraph.h:3568
3568 if (!alias)
(gdb) list
3563
3564 inline symtab_node *
3565 symtab_node::ultimate_alias_target (enum availability *availability,
3566 symtab_node *ref)
3567 {
3568 if (!alias)
3569 {
3570 if (availability)
3571 *availability = get_availability (ref);
3572 return this;
With
(gdb) p t
$4 = (tree) 0x7ffff70ff1c8
(gdb) p debug_tree(t)
<var_decl 0x7ffff70ff1c8 A$linkptr
type <pointer_type 0x7ffff70fe540
type <array_type 0x7ffff70fe1f8 type <integer_type 0x7ffff700b5e8 int>
BLK
size <integer_cst 0x7ffff70026a8 constant 32>
unit-size <integer_cst 0x7ffff70026c0 constant 4>
align:32 warn_if_not_align:0 symtab:0 alias-set 6
structural-equality domain <integer_type 0x7ffff70fe150>
pointer_to_this <pointer_type 0x7ffff70fe540>>
public unsigned DI
size <integer_cst 0x7ffff7002468 constant 64>
unit-size <integer_cst 0x7ffff7002480 constant 8>
align:64 warn_if_not_align:0 symtab:0 alias-set 5 structural-equality
pointer_to_this <pointer_type 0x7ffff71057e0>>
used public static unsigned DI (null):0:0 size <integer_cst 0x7ffff7002468
64> unit-size <integer_cst 0x7ffff7002480 8>
align:64 warn_if_not_align:0>