https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122663
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #5)
> (In reply to Richard Biener from comment #4)
> > Created attachment 62783 [details]
> > prototype patch
> >
> > I'm testing this if it works. It misses replacing the hash-set with a
> > bitmap and removing the remap_ssa_name check which should no longer be
> > necessary given we are not removing stmts during the inlining but only
> > afterwards.
>
> The unused compare_ssa_versions function needs to be removed. Then we
> ICE building sel-sched.cc with debug info.
>
> ../../gcc/gcc/sel-sched.cc:5990:1: error: missing definition
> 5990 | move_op_orig_expr_found (insn_t insn, expr_t expr,
> | ^~~~~~~~~~~~~~~~~~~~~~~
> for SSA_NAME: insn_emitted_30 in statement:
> # DEBUG insn_emitted => insn_emitted_30
> during GIMPLE pass: fixup_cfg
>
> possibly hinting at either a missed optimization in simple-dce-with-worklist
> or a bogus DCE assumed by the current IPA machinery.
>
> Ah, it's probably the call stmt itself where we leave a dangling SSA def,
> so we have to keep the LHS on the new stmt.
And simple_dce_from_worklist does not remove LHS from calls, so we get
../../gcc/gcc/dwarf2out.cc: In function ‘bool
add_location_or_const_value_attribute(dw_die_ref, tree, bool)’:
../../gcc/gcc/dwarf2out.cc:21258:1: error: invalid conversion in gimple call
21258 | add_location_or_const_value_attribute (dw_die_ref die, tree decl, bool
cache_p)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bool
void
# .MEM_78 = VDEF <.MEM_61>
_54 = tree_add_const_value_attribute_for_decl.isra (die_4(D), decl.2142_2);