On Tue, Dec 3, 2019 at 11:51 PM Erick Ochoa <erick.oc...@theobroma-systems.com> wrote: > > Hi, > > I am trying to use the function: `cgraph_node::get_untransformed_body` during > the wpa stage of a SIMPLE_IPA_PASS transformation. While the execute function
I think SIMPLE_IPA_PASSes have no "WPA" stage but run at LTRANS time (WPA transform stage). So you might simply see that not all bodies are available in your LTRANS unit? > is running, I need to access the body of a function in order to iterate over > the gimple instructions in the first basic block. I have found that the > majority of the cgraph_node will return successfully. However, there are some > functions which consistently produce a segmentation fault following this > stacktrace: > > ``` > 0xbc2adb crash_signal > /home/eochoa/code/gcc/gcc/toplev.c:328 > 0xa54858 lto_get_decl_name_mapping(lto_file_decl_data*, char const*) > /home/eochoa/code/gcc/gcc/lto-section-in.c:367 > 0x7030e7 cgraph_node::get_untransformed_body() > /home/eochoa/code/gcc/gcc/cgraph.c:3516 > 0x150613f get_bb1_callees > /home/eochoa/code/gcc/gcc/ipa-initcall-cp.c:737 > 0x150613f reach_nodes_via_bb1_dfs > ``` > > Is there a way for `cgraph_node::get_untransformed_body` to succeed > consistently? (I.e. are there some preconditions that I need to make sure are > in place before calling cgraph_node::get_untransformed_body? > > I am using gcc version 10.0.0 20191127 (experimental) > > Thanks