https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65779
--- Comment #10 from baoshan <pangbw at gmail dot com> --- This is my fix for this issue, any comment is welcome. --- 10 gcc/function.c | 5 +++-- 11 1 files changed, 3 insertions(+), 2 deletions(-) 12 13 diff --git a/gcc/function.c b/gcc/function.c 14 index 1a8682b..a9df397 100644 15 --- a/gcc/function.c 16 +++ b/gcc/function.c 17 @@ -5561,8 +5561,9 @@ prepare_shrink_wrap (basic_block entry_block) 18 CLEAR_HARD_REG_SET (uses); 19 CLEAR_HARD_REG_SET (defs); 20 FOR_BB_INSNS_REVERSE_SAFE (entry_block, insn, curr) 21 - if (NONDEBUG_INSN_P (insn) 22 - && !move_insn_for_shrink_wrap (entry_block, insn, uses, defs)) 23 + if (INSN_P(insn) && 24 + (DEBUG_INSN_P (insn) 25 + || !move_insn_for_shrink_wrap (entry_block, insn, uses, defs))) 26 { 27 /* Add all defined registers to DEFs. */ 28 for (ref = DF_INSN_DEFS (insn); *ref; ref++)