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 <[email protected]> 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 <[email protected]> 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
>>
>