https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71908
Bug ID: 71908 Summary: ICE at -Os and above in both 32-bit and 64-bit modes on x86_64-linux-gnu (get_constraint_for_component_ref) Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization 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 20160716 (experimental) [trunk revision 238415] (GCC) $ $ gcc-trunk -O3 small.c small.c: In function ‘main’: small.c:10:5: internal compiler error: in get_constraint_for_component_ref, at tree-ssa-structalias.c:3217 int main() { ^~~~ 0xda58ec get_constraint_for_component_ref ../../gcc-source-trunk/gcc/tree-ssa-structalias.c:3217 0xda58ec get_constraint_for_1 ../../gcc-source-trunk/gcc/tree-ssa-structalias.c:3485 0xda9500 find_func_aliases ../../gcc-source-trunk/gcc/tree-ssa-structalias.c:4779 0xdaf22e compute_points_to_sets ../../gcc-source-trunk/gcc/tree-ssa-structalias.c:7056 0xdaf22e compute_may_aliases() ../../gcc-source-trunk/gcc/tree-ssa-structalias.c:7414 0xae7924 execute_function_todo ../../gcc-source-trunk/gcc/passes.c:1936 0xae84eb execute_todo ../../gcc-source-trunk/gcc/passes.c:2016 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 struct S3 { int f3; int f5; char f6; int f7; } b; int a; static struct S3 *c = &b; int *d; int main() { int i; for (;;) { a = 0; int **e = &d; i = 0; for (; i < 2; i++) d = &(*c).f5; *e = d; **e = 3; } return 0; } $