https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103562
Martin Liška <marxin at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2021-12-06 CC| |marxin at gcc dot gnu.org Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> --- Thanks for the report. I added: gcc_jit_context_set_bool_option(ctxt, GCC_JIT_BOOL_OPTION_DUMP_EVERYTHING, 1); gcc_jit_context_set_bool_option(ctxt, GCC_JIT_BOOL_OPTION_KEEP_INTERMEDIATES, 1); and I can see in the very first dump file: $ cat fake.c.006t.gimple struct my_struct deref (struct my_struct * ptr) { <D.79>: <retval> = *ptr; return <retval>; } long int get_a (struct my_struct * ptr) { long int D.87; struct my_struct D.88; <D.83>: D.88 = deref (ptr); [return slot optimization] D.87 = D.88.a; return D.87; } So there's fishy the [return slot optimization]. @David: Can you please take a look?