https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82166
Bug ID: 82166 Summary: gcc ICE at -Os on valid code on x86_64-linux-gnu in "ix86_finalize_stack_frame_flags" Product: gcc Version: 8.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: --- $ 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/8.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 8.0.0 20170909 (experimental) [trunk revision 251936] (GCC) $ gcc-trunk -Os -m32 abc.c abc.c:1:6: warning: conflicting types for built-in function ‘printf’ [-Wbuiltin-declaration-mismatch] void printf(); ^~~~~~ during RTL pass: pro_and_epilogue abc.c: In function ‘main’: abc.c:9:1: internal compiler error: in ix86_finalize_stack_frame_flags, at config/i386/i386.c:14271 } ^ 0x7ada6c ix86_finalize_stack_frame_flags ../../gcc/gcc/config/i386/i386.c:14271 0xfc71fb ix86_expand_epilogue(int) ../../gcc/gcc/config/i386/i386.c:15414 0x11b7b8f gen_epilogue() ../../gcc/gcc/config/i386/i386.md:12700 0xfaae48 target_gen_epilogue ../../gcc/gcc/config/i386/i386.md:12211 0xae15e8 make_epilogue_seq ../../gcc/gcc/function.c:5864 0xae16fc thread_prologue_and_epilogue_insns() ../../gcc/gcc/function.c:5946 0xae1dc2 rest_of_handle_thread_prologue_and_epilogue ../../gcc/gcc/function.c:6436 0xae1dc2 execute ../../gcc/gcc/function.c:6478 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 abc.c void printf(); int a, b, c; int main() { int j; for (; c;) a = b; for (; j;) printf(); }