https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78527

            Bug ID: 78527
           Summary: 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)
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chengniansun at gmail dot com
  Target Milestone: ---

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/usr/local/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 7.0.0 20161125 (experimental) [trunk revision 242857] (GCC) 
$ 
$ gcc-trunk -O3 small.c
small.c: In function ‘main’:
small.c:16:1: internal compiler error: in smallest_mode_for_size, at
stor-layout.c:364
 }
 ^
0xbd6ff0 smallest_mode_for_size(unsigned int, mode_class)
        ../../gcc-source-trunk/gcc/stor-layout.c:364
0x12ad7b6 make_extraction
        ../../gcc-source-trunk/gcc/combine.c:7557
0x12b1998 make_compound_operation_int
        ../../gcc-source-trunk/gcc/combine.c:8102
0x12b1998 make_compound_operation(rtx_def*, rtx_code)
        ../../gcc-source-trunk/gcc/combine.c:8210
0x12b134a make_compound_operation(rtx_def*, rtx_code)
        ../../gcc-source-trunk/gcc/combine.c:8234
0x12b4139 simplify_set
        ../../gcc-source-trunk/gcc/combine.c:6730
0x12b57e7 combine_simplify_rtx
        ../../gcc-source-trunk/gcc/combine.c:6167
0x12b7a52 subst
        ../../gcc-source-trunk/gcc/combine.c:5467
0x12b752a subst
        ../../gcc-source-trunk/gcc/combine.c:5335
0x12b8e07 try_combine
        ../../gcc-source-trunk/gcc/combine.c:3313
0x12be812 combine_instructions
        ../../gcc-source-trunk/gcc/combine.c:1285
0x12be812 rest_of_handle_combine
        ../../gcc-source-trunk/gcc/combine.c:14549
0x12be812 execute
        ../../gcc-source-trunk/gcc/combine.c:14594
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
$ 
$ cat small.c
unsigned a;
short b, e;
int *c;
char d;
int main() {
  int f = 80;
  for (;;) {
    if (f > 432)
      *c = a;
    while (b)
      if (d)
        e = -(a >> f);
    c = &f;
    b = e;
  }
}
$

Reply via email to