https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71976
--- Comment #7 from Georg-Johann Lay <gjl at gcc dot gnu.org> --- ...hmmm this place might be correct. combine defines #define RTL_HOOKS_REG_NUM_SIGN_BIT_COPIES reg_num_sign_bit_copies_for_combine and this function comes up with reg_num_sign_bit_copies_for_combine (x=0x7ffff734ee70, mode=DImode, known_x=0x0, known_mode=VOIDmode, known_ret=0, result=0x7fffffff8fb0) at ../../../gcc.gnu.org/trunk/gcc/combine.c:9928 (gdb) p x $112 = (const_rtx) 0x7ffff734ee70 (gdb) pr (reg:DI 18 r18) and get_last_value (x) returns 0. Before combine we have (insn 43 31 44 2 (set (reg:QI 18 r18) (const_int 0 [0])) bug-combin.c:29 56 {movqi_insn} (nil)) (insn 44 43 45 2 (set (reg:QI 19 r19 [+1 ]) (const_int 0 [0])) bug-combin.c:29 56 {movqi_insn} (nil)) (insn 45 44 46 2 (set (reg:QI 20 r20 [+2 ]) (const_int 0 [0])) bug-combin.c:29 56 {movqi_insn} (nil)) (insn 46 45 47 2 (set (reg:QI 21 r21 [+3 ]) (const_int 0 [0])) bug-combin.c:29 56 {movqi_insn} (nil)) (insn 47 46 48 2 (set (reg:QI 22 r22 [+4 ]) (const_int 0 [0])) bug-combin.c:29 56 {movqi_insn} (nil)) (insn 48 47 49 2 (set (reg:QI 23 r23 [+5 ]) (reg:QI 65 [ _3+5 ])) bug-combin.c:29 56 {movqi_insn} (nil)) (insn 49 48 50 2 (set (reg:QI 24 r24 [+6 ]) (reg:QI 66 [ _3+6 ])) bug-combin.c:29 56 {movqi_insn} (nil)) (insn 50 49 51 2 (set (reg:QI 25 r25 [+7 ]) (reg:QI 67 [ _3+7 ])) bug-combin.c:29 56 {movqi_insn} (nil)) (insn 51 50 52 2 (set (reg:QI 16 r16) (const_int 40 [0x28])) bug-combin.c:29 56 {movqi_insn} (nil)) (insn 52 51 61 2 (set (reg:DI 18 r18) (ashiftrt:DI (reg:DI 18 r18) (reg:QI 16 r16))) bug-combin.c:29 1417 {ashrdi3_insn} (expr_list:REG_DEAD (reg:QI 16 r16) (nil))) Note that we have hard reg DI 18 in insn 52 and a set of hard reg QI 18 in insn 43! get_last_value is called for DI 18 bit only looks at the LSB byte in QI 18 and hence returns 0 which is a bug.