https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65680
Bug ID: 65680 Summary: ICE at -O1 and above on x86_64-linux-gnu in expand_assignment, at expr.c:4830 Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: su at cs dot ucdavis.edu The following code causes an ICE when compiled with the current gcc trunk at -O1 and above on x86_64-linux-gnu in the 64-bit mode (but not in the 32-bit mode). It also affects 4.9.2 and 4.8.4. $ gcc-trunk -v Using built-in specs. COLLECT_GCC=gcc-trunk COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-unknown-linux-gnu/5.0.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../gcc-trunk/configure --prefix=/usr/local/gcc-trunk --enable-languages=c,c++ --disable-werror --enable-multilib Thread model: posix gcc version 5.0.0 20150406 (experimental) [trunk revision 221876] (GCC) $ $ gcc-trunk -O0 -c small.c $ $ gcc-trunk -O1 -c small.c small.c: In function ‘fn1’: small.c:9:28: internal compiler error: in expand_assignment, at expr.c:4830 a[100000000000000000][0] = b; ^ 0x81f0c5 expand_assignment(tree_node*, tree_node*, bool) ../../gcc-trunk/gcc/expr.c:4830 0x71fbb7 expand_gimple_stmt_1 ../../gcc-trunk/gcc/cfgexpand.c:3401 0x71fbb7 expand_gimple_stmt ../../gcc-trunk/gcc/cfgexpand.c:3497 0x7248e6 expand_gimple_basic_block ../../gcc-trunk/gcc/cfgexpand.c:5509 0x727607 execute ../../gcc-trunk/gcc/cfgexpand.c:6127 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. $ ----------------------------- struct S0 { int f0:1; } a[100000000000000001][3]; void fn1() { struct S0 b = { 0 }; a[100000000000000000][0] = b; }