https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123652
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
The reason for the missed CSE from the "bad" initial RTL is likely the overlap
trick we're using for the initialization of the stack temporary:
;; D.18588 = {};
(insn 5 4 6 (set (mem/c:SI (plus:DI (reg/f:DI 93 virtual-stack-vars)
(const_int -7 [0xfffffffffffffff9])) [0 D.18588+0 S4 A8])
(const_int 0 [0])) "t.C":5:13 -1
(nil))
(insn 6 5 0 (set (mem/c:SI (plus:DI (reg/f:DI 93 virtual-stack-vars)
(const_int -4 [0xfffffffffffffffc])) [0 D.18588+3 S4 A8])
(const_int 0 [0])) "t.C":5:13 -1
(nil))
CSE fails to handle
(insn 8 7 9 (set (reg:DI 100)
(zero_extend:DI (mem/c:SI (plus:DI (reg/f:DI 93 virtual-stack-vars)
(const_int -7 [0xfffffffffffffff9])) [0 D.18588+0 S4 A8])))
"t.C":5:13 discrim 1 -1
(nil))
with the partial clobber from the 2nd store. That trick is "new" and thus
likely the bisect point.