https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81571
Bug ID: 81571 Summary: ICE at -O3 on x86_64-linux-gnu in both 32-bit and 64-bit modes (internal compiler error: in as_a, at is-a.h:192) Product: gcc Version: unknown 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/8.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 8.0.0 20170726 (experimental) [trunk revision 250555] (GCC) $ gcc-trunk -O3 small.c small.c: In function ‘fn1’: small.c:2:7: warning: type of ‘p1’ defaults to ‘int’ [-Wimplicit-int] short fn1(p1) { return p1; } ^~~ during GIMPLE pass: vect small.c: In function ‘main’: small.c:6:5: internal compiler error: in as_a, at is-a.h:192 int main() { ^~~~ 0x5c7e8b as_a<gphi*, gimple> ../../gcc-source-trunk/gcc/is-a.h:192 0x5c7e96 as_a<gphi*, gimple> ../../gcc-source-trunk/gcc/is-a.h:192 0x5c7e96 gimple_phi_arg ../../gcc-source-trunk/gcc/gimple.h:4362 0x5c7e96 gimple_phi_arg_def ../../gcc-source-trunk/gcc/gimple.h:4406 0x5ca73e get_initial_defs_for_reduction ../../gcc-source-trunk/gcc/tree-vect-loop.c:4254 0x5cabc4 vect_create_epilog_for_reduction ../../gcc-source-trunk/gcc/tree-vect-loop.c:4476 0xecf1c0 vectorizable_reduction(gimple*, gimple_stmt_iterator*, gimple**, _slp_tree*, _slp_instance*) ../../gcc-source-trunk/gcc/tree-vect-loop.c:6526 0xec072c vect_transform_stmt(gimple*, gimple_stmt_iterator*, bool*, _slp_tree*, _slp_instance*) ../../gcc-source-trunk/gcc/tree-vect-stmts.c:8719 0xee2922 vect_schedule_slp_instance ../../gcc-source-trunk/gcc/tree-vect-slp.c:3724 0xee3233 vect_schedule_slp(vec_info*) ../../gcc-source-trunk/gcc/tree-vect-slp.c:3796 0xec87bb vect_transform_loop(_loop_vec_info*) ../../gcc-source-trunk/gcc/tree-vect-loop.c:7614 0xeeada3 vectorize_loops() ../../gcc-source-trunk/gcc/tree-vectorizer.c:745 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. $ cat small.c int a, b, c, d; short fn1(p1) { return p1; } int fn2(int p1) {} int main() { for (; c; c++) a |= fn1(1, a) | fn2(b |= d); return 0; } $