This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/78527] [7 Regression] ice on valid C code at -O3 in both 32-bit and 64-bit modes on x86_64-linux-gnu (internal compiler error: in smallest_mode_for_size, at stor-layout.c:364)
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 25 Nov 2016 12:39:11 +0000
- Subject: [Bug rtl-optimization/78527] [7 Regression] ice on valid C code at -O3 in both 32-bit and 64-bit modes on x86_64-linux-gnu (internal compiler error: in smallest_mode_for_size, at stor-layout.c:364)
- Auto-submitted: auto-generated
- References: <bug-78527-4@http.gcc.gnu.org/bugzilla/>
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.