https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70152
Bug ID: 70152 Summary: gcc ICE at -O3 and above on valid code on x86_64-linux-gnu in "replace_uses_by" Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: helloqirun at gmail dot com Target Milestone: --- The following valid code causes an ICE when compiled with the current gcc trunk at -O3 and above on x86_64-linux-gnu in both 32-bit and 64-bit modes. It should be a 6 regression. $ gcc-trunk -v Using built-in specs. COLLECT_GCC=gcc-trunk COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc --enable-languages=c,c++ --disable-werror --enable-multilib Thread model: posix gcc version 6.0.0 20160308 (experimental) [trunk revision 234065] (GCC) $ gcc-trunk -O3 abc.c abc.c: In function 'zfgetline.isra.0': abc.c:17:1: internal compiler error: in replace_uses_by, at tree-cfg.c:1825 } ^ 0xb96859 replace_uses_by(tree_node*, tree_node*) ../../gcc/gcc/tree-cfg.c:1825 0xc3a82e replace_removed_params_ssa_names ../../gcc/gcc/tree-sra.c:4771 0xc3cdce ipa_sra_modify_function_body(vec<ipa_parm_adjustment, va_heap, vl_ptr>) ../../gcc/gcc/tree-sra.c:4854 0xc3d5d1 modify_function ../../gcc/gcc/tree-sra.c:5173 0xc477b6 ipa_early_sra ../../gcc/gcc/tree-sra.c:5403 0xc477b6 execute ../../gcc/gcc/tree-sra.c:5450 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 abc.c int a; int fgetc (); void _setjmp (); static int zfgetline (int p1) { p1 = 0; _setjmp (); for (;;) switch (p1) case 5: p1 = fgetc (); } void zftp_login () { zfgetline (a); }