https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109231
--- Comment #25 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to r...@cebitec.uni-bielefeld.de from comment #24) > > --- Comment #23 from Jakub Jelinek <jakub at gcc dot gnu.org> --- > [...] > > Perhaps try to undo my patch in a different way, like > > --- gcc/tree-inline.cc 2023-03-17 18:59:50.226199917 +0100 > > +++ gcc/tree-inline.cc 2023-03-29 12:47:21.546947442 +0200 > > @@ -2785,7 +2785,7 @@ initialize_cfun (tree new_fndecl, tree c > > gimple_register_cfg_hooks (); > > > > /* Get clean struct function. */ > > - push_struct_function (new_fndecl, true); > > + push_struct_function (new_fndecl, false); > > targetm.target_option.relayout_function (new_fndecl); > > > > /* We will rebuild these, so just sanity check that they are empty. */ > > or > > --- gcc/tree-inline.cc 2023-03-17 18:59:50.226199917 +0100 > > +++ gcc/tree-inline.cc 2023-03-29 12:49:16.580255668 +0200 > > @@ -2786,7 +2786,11 @@ initialize_cfun (tree new_fndecl, tree c > > > > /* Get clean struct function. */ > > push_struct_function (new_fndecl, true); > > + relayout_decl (DECL_RESULT (new_fndecl)); > > + for (tree parm = DECL_ARGUMENTS (new_fndecl); parm; parm = DECL_CHAIN > > (parm)) > > + relayout_decl (parm); > > targetm.target_option.relayout_function (new_fndecl); > > + aggregate_value_p (DECL_RESULT (new_fndecl), new_fndecl); > > > > /* We will rebuild these, so just sanity check that they are empty. */ > > gcc_assert (VALUE_HISTOGRAMS (cfun) == NULL); > > and see if that changes anything? Of course both of those patches break the > > PR105554 > > again. Or if the latter helps, try to comment out the different parts of it > > too. > > So far, I've tried both variants and in each case, the comparison > failure is gone. Given that the reproducers weren't reliable, I'm afraid it would take at least 2-3 runs to get something that says something. Anyway, as I said for the second version, it would be nice to also try subvariants: // relayout_decl (DECL_RESULT (new_fndecl)); for (tree parm = DECL_ARGUMENTS (new_fndecl); parm; parm = DECL_CHAIN (parm)) relayout_decl (parm); targetm.target_option.relayout_function (new_fndecl); // aggregate_value_p (DECL_RESULT (new_fndecl), new_fndecl); and relayout_decl (DECL_RESULT (new_fndecl)); // for (tree parm = DECL_ARGUMENTS (new_fndecl); parm; parm = DECL_CHAIN (parm)) // relayout_decl (parm); targetm.target_option.relayout_function (new_fndecl); // aggregate_value_p (DECL_RESULT (new_fndecl), new_fndecl); and // relayout_decl (DECL_RESULT (new_fndecl)); // for (tree parm = DECL_ARGUMENTS (new_fndecl); parm; parm = DECL_CHAIN (parm)) // relayout_decl (parm); targetm.target_option.relayout_function (new_fndecl); aggregate_value_p (DECL_RESULT (new_fndecl), new_fndecl); so see if the comparison failure is fixed by the result relayout, or by argument relayout or by the aggregate_value_p call actually having some side-effects other than return value.