https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108573
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ebotcazou at gcc dot gnu.org --- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- So, I believe this has been caused by the r7-4871-g4da41abf84cc6796aa8b PR78437 change. /* On RISC machines we must make sure that changing the mode of SRC_REG as destination register will not affect its reaching uses, which may read its value in a larger mode because DEF_INSN implicitly sets it in word mode. */ poly_int64 prec = GET_MODE_PRECISION (GET_MODE (SET_DEST (*dest_sub_rtx))); if (WORD_REGISTER_OPERATIONS && known_lt (prec, BITS_PER_WORD)) { struct df_link *uses = get_uses (def_insn, src_reg); if (!uses) return false; for (df_link *use = uses; use; use = use->next) if (paradoxical_subreg_p (GET_MODE (*DF_REF_LOC (use->ref)), GET_MODE (SET_DEST (*dest_sub_rtx)))) return false; } The problem is that without -g, there are just 2 uses: (insn 10029 10027 10052 2 (set (reg:SI 10 a0 [167]) (minus:SI (reg:SI 10 a0 [160]) (reg:SI 9 s1 [165]))) "pr108573.c":12:5 12 {subsi3} (nil)) and (insn 10023 9 10027 2 (set (reg:DI 15 a5 [orig:139 _6 ] [139]) (sign_extend:DI (reg:SI 10 a0 [160]))) "pr108573.c":11:5 116 {extendsidi2} (nil)) but with -g there another one: (debug_insn 8 7 9 2 (var_location:HI s (minus:HI (subreg:HI (and:DI (reg:DI 10 a0 [160]) (const_int 1 [0x1])) 0) (subreg:HI (ashiftrt:DI (reg/v:DI 9 s1 [orig:151 l ] [151]) (debug_expr:SI D#1)) 0))) "pr108573.c":12:5 -1 (nil)) Now, because it uses DImode for a0 rather than SImode like the others, without -g we don't return false but with -g we do. Code generation decisions shouldn't be based on the DEBUG_INSN uses. So, at least in this decision we should ignore debug uses, we can then do something with the DEBUG_INSNs, reset them, adjust, whatever (I think at least the above one clearly doesn't care about the upper bits).