https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78527
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- 8097 int width = GET_MODE_PRECISION (GET_MODE (inner)) 8098 - INTVAL (XEXP (inner, 1)); 8099 if (width > mode_width) 8100 width = mode_width; 8101 new_rtx = make_extraction (mode, new_rtx, 0, XEXP (inner, 1), 8102 width, 1, 0, in_code == COMPARE); x is (subreg:HI (lshiftrt:SI (mem/c:SI (symbol_ref:DI ("a") [flags 0x2] <var_decl 0x7ffff7ff9e10 a>) [1 a+0 S4 A32]) (const_int 80 [0x50])) 0) mode_width is 16, but width is -48. I'd just guard it for valid shift counts.