https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99863
--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> --- So, I think we want to do: --- gcc/dse.c.jj 2021-01-28 09:59:11.973750676 +0100 +++ gcc/dse.c 2021-04-01 15:16:22.003913061 +0200 @@ -1970,8 +1970,7 @@ get_stored_val (store_info *store_info, static bool replace_read (store_info *store_info, insn_info_t store_insn, - read_info_t read_info, insn_info_t read_insn, rtx *loc, - bitmap regs_live) + read_info_t read_info, insn_info_t read_insn, rtx *loc) { machine_mode store_mode = GET_MODE (store_info->mem); machine_mode read_mode = GET_MODE (read_info->mem); @@ -2040,7 +2039,8 @@ replace_read (store_info *store_info, in note_stores (this_insn, look_for_hardregs, regs_set); } - bitmap_and_into (regs_set, regs_live); + if (store_insn->fixed_regs_live) + bitmap_and_into (regs_set, store_insn->fixed_regs_live); if (!bitmap_empty_p (regs_set)) { if (dump_file && (dump_flags & TDF_DETAILS)) @@ -2286,7 +2286,7 @@ check_mem_read_rtx (rtx *loc, bb_info_t offset - store_info->offset, width) && replace_read (store_info, i_ptr, read_info, - insn_info, loc, bb_info->regs_live)) + insn_info, loc)) return; /* The bases are the same, just see if the offsets @@ -2352,8 +2352,7 @@ check_mem_read_rtx (rtx *loc, bb_info_t store_info->width) && all_positions_needed_p (store_info, offset - store_info->offset, width) - && replace_read (store_info, i_ptr, read_info, insn_info, loc, - bb_info->regs_live)) + && replace_read (store_info, i_ptr, read_info, insn_info, loc)) return; remove = canon_true_dependence (store_info->mem, to fix this. Perhaps together with filling fixed_regs_live on more stores, currently we fill it in only for insn with exactly one store or on memset calls, perhaps we want to fill it on insns with more than one store?