https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106075
--- Comment #11 from Eric Botcazou <ebotcazou at gcc dot gnu.org> --- > Eric, maybe you can help with RTL DSE here? The problem is that add_non_frame_wild_read is exclusive, i.e. the read is turned into a read from *only* non-frame memory, but can_throw_external is conservative and may return true for a read from frame memory: (insn 15 13 16 4 (set (reg:QI 87 [ _20 ]) (mem:QI (plus:DI (reg/f:DI 100) (reg:DI 92 [ ivtmp.23 ])) [8 MEM <character> [(interfaces__unsigned_32 *)&value.4 + ivtmp.23_39 * 1]+0 S1 A8])) "opt47.adb":22:13 91 {*movqi_internal} value.4 is a local variable but can_throw_external return true on the read. So you would need to implement an inclusive version of add_non_frame_wild_read but the change is going to pessimize Ada and Go if the condition to invoke it is not made more precise.