This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug ipa/79776] [7 Regression] ICE on valid code in insert_vi_for_tree, at tree-ssa-structalias.c:2807


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |rguenth at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
So, we first insert_vi_for_tree on the FUNCTION_DECL:
#0  insert_vi_for_tree (t=<function_decl 0x7fffefc4b400 _ZThn8_N1C2fnEPKciPi>,
vi=0x2ba04d0) at ../../gcc/tree-ssa-structalias.c:2806
#1  0x00000000013a1a36 in create_function_info_for (decl=<function_decl
0x7fffefc4b400 _ZThn8_N1C2fnEPKciPi>, name=0x1e3b24b "NULL", 
    add_id=false, nonlocal_p=true) at ../../gcc/tree-ssa-structalias.c:5666
#2  0x00000000013a77a5 in ipa_pta_execute () at
../../gcc/tree-ssa-structalias.c:7804
#3  0x00000000013a88d9 in (anonymous namespace)::pass_ipa_pta::execute
(this=0x2a6d9d0) at ../../gcc/tree-ssa-structalias.c:8142
#4  0x000000000100973c in execute_one_pass (pass=<opt_pass* 0x2a6d9d0
"pta"(90)>) at ../../gcc/passes.c:2465
and then later reach the same FUNCTION_DECL because it is an alias of another
function:
#0  insert_vi_for_tree (t=<function_decl 0x7fffefc4b400 _ZThn8_N1C2fnEPKciPi>,
vi=0x2ba0750) at ../../gcc/tree-ssa-structalias.c:2806
#1  0x00000000013a6ef4 in associate_varinfo_to_alias (node=<cgraph_node*
0x7fffefc69b80 "_ZThn8_N1C2fnEPKciPi">, data=0x2ba0750)
    at ../../gcc/tree-ssa-structalias.c:7620
#2  0x0000000000bcfb2a in cgraph_node::call_for_symbol_thunks_and_aliases
(this=<cgraph_node* 0x7fffefc69b80 "_ZThn8_N1C2fnEPKciPi">, callback=
    0x13a6ea0 <associate_varinfo_to_alias(cgraph_node*, void*)>,
data=0x2ba0750, include_overwritable=true, exclude_virtual_thunks=false)
    at ../../gcc/cgraph.c:2354
#3  0x0000000000bcfc86 in cgraph_node::call_for_symbol_thunks_and_aliases
(this=<cgraph_node* 0x7fffefc54450 "*.LTHUNK0">, callback=
    0x13a6ea0 <associate_varinfo_to_alias(cgraph_node*, void*)>,
data=0x2ba0750, include_overwritable=true, exclude_virtual_thunks=false)
    at ../../gcc/cgraph.c:2375
#4  0x0000000000bcfbbc in cgraph_node::call_for_symbol_thunks_and_aliases
(this=<cgraph_node* 0x7fffefc542e0 "fn">, callback=
    0x13a6ea0 <associate_varinfo_to_alias(cgraph_node*, void*)>,
data=0x2ba0750, include_overwritable=true, exclude_virtual_thunks=false)
    at ../../gcc/cgraph.c:2362
#5  0x00000000013a792b in ipa_pta_execute () at
../../gcc/tree-ssa-structalias.c:7822

Seems we first create a cgraph node for a thunk, later on
cgraph_node::expand_thunk lowers it and clears thunk.thunk_p = false; on it,
then
#6  0x0000000000be4bc0 in cgraph_node::create_clone (this=<cgraph_node*
0x7fffefc54a10 "_ZThn8_N1C2fnEPKciPi">, 
    new_decl=<function_decl 0x7fffefc4b400 _ZThn8_N1C2fnEPKciPi>, gcov_count=0,
freq=524, update_original=true, redirect_callers=..., 
    call_duplication_hook=true, new_inlined_to=<cgraph_node* 0x7fffefc54170
"fn2">, args_to_skip=0x0, suffix=0x0) at ../../gcc/cgraphclones.c:430
#7  0x0000000001b91811 in clone_inlined_nodes (e=0x7fffefc6b2d8,
duplicate=true, update_original=true, 
    overall_size=0x2a2dfc0 <_ZL12overall_size>, freq_scale=524) at
../../gcc/ipa-inline-transform.c:227
#8  0x0000000001b918cc in clone_inlined_nodes (e=0x7fffefc6b2d8,
duplicate=true, update_original=true, 
    overall_size=0x2a2dfc0 <_ZL12overall_size>, freq_scale=524) at
../../gcc/ipa-inline-transform.c:242
Python Exception <class 'gdb.error'> There is no member or method named
m_vecpfx.: 
#9  0x0000000001b9242a in inline_call (e=0x7fffefaccaf8, update_original=true,
new_edges=0x7fffffffdbd0, 
    overall_size=0x2a2dfc0 <_ZL12overall_size>, update_overall_summary=true,
callee_removed=0x0) at ../../gcc/ipa-inline-transform.c:449
#10 0x0000000001b88599 in inline_small_functions () at
../../gcc/ipa-inline.c:2024
#11 0x0000000001b89903 in ipa_inline () at ../../gcc/ipa-inline.c:2434
creates yet another cgraph_node for the same FUNCTION_DECL.  And the above
first insert_vi_for_tree is from the first thunk with cleared thunk_p, and the
latter for the inline clone.  Perhaps associate_varinfo_to_alias should ignore
inlining clones?

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]