Thank you again for the help. I think the root cause is that instead of
using GIMPLE_PASS, my analysis requires to do IPA. I am struggling in
switching to SIMPLE_IPA_PASS now....

Best,
Shuai

On Wed, Feb 17, 2021 at 8:41 AM Shuai Wang <wangshuai...@gmail.com> wrote:

> I think the gist is that the recovered pointer itself is somehow NULL:
>
>             tree current_fn_decl = gimple_call_fndecl(stmt);
>             if (!current_fn_decl) return false;   // *this won't execute*
>             struct function* fs0 = DECL_STRUCT_FUNCTION(current_fn_decl);
>             if (!fs0) {
>               std::cerr << "error pointer ! " << get_name(fs0->decl) <<
> std::endl;   // *this will execute*
>             }
>
>
> On Wed, Feb 17, 2021 at 8:24 AM Shuai Wang <wangshuai...@gmail.com> wrote:
>
>> Hello Martin,
>>
>> Thanks for the information. I tried but it's the same error. Is it
>> possibly due to some bugs or something? I use gcc 10.1.0.
>>
>> Best,
>> Shuai
>>
>> On Wed, Feb 17, 2021 at 2:36 AM Martin Liška <mli...@suse.cz> wrote:
>>
>>> On 2/16/21 1:13 PM, Shuai Wang wrote:
>>> > std::cerr << get_name(f->decl) << std::endl;
>>>
>>> You likely want to use cgraph_node::get (f->decl)->name ()
>>>
>>> Martin
>>>
>>

Reply via email to