https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95314
Bug ID: 95314 Summary: Sharing a local reference to a global variable in multiple functions results in location references block not in block tree Product: gcc Version: 10.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: jit Assignee: dmalcolm at gcc dot gnu.org Reporter: bouanto at zoho dot com Target Milestone: --- Hi. If a create, in a function, a reference (with gcc_jit_lvalue_get_address) to a global and reuse this local reference in another function, it gives the following error: libgccjit.so: error: location references block not in block tree … during IPA pass: *free_lang_data libgccjit.so: error: verify_gimple failed 0x7f83924b35c9 verify_gimple_in_cfg(function*, bool) ../../gcc-10.1.0/gcc/tree-cfg.c:5462 0x7f839236a819 execute_function_todo ../../gcc-10.1.0/gcc/passes.c:1985 0x7f839236add7 do_per_function ../../gcc-10.1.0/gcc/passes.c:1647 0x7f839236b06b do_per_function ../../gcc-10.1.0/gcc/passes.c:2050 0x7f839236b06b execute_todo ../../gcc-10.1.0/gcc/passes.c:2039 I can try to make an example to reproduce this issue if needed. Is that the expected behavior or should libgccjit gives a proper error? (Recreating the reference in every function fix this issue.) Thanks.