https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64559
Bug ID: 64559 Summary: ICE at -Os on x86_64-linux-gnu in remove_unreachable_nodes, at ipa.c:582 Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ipa 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 -Os only on x86_64-linux-gnu in both 32-bit and 64-bit modes. It is a regression from 4.9.x. It seems to be the same as PR 64068, but -fno-ipa-icf does not make this ICE disappear. $ 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 20150110 (experimental) [trunk revision 219421] (GCC) $ $ gcc-trunk -O1 small.c; a.out $ gcc-4.9 -Os small.c; a.out $ $ gcc-trunk -Os -fno-ipa-icf small.c small.c:36:1: internal compiler error: in remove_unreachable_nodes, at ipa.c:582 } ^ 0x91228d symbol_table::remove_unreachable_nodes(_IO_FILE*) ../../gcc-trunk/gcc/ipa.c:582 0x110910b ipa_inline ../../gcc-trunk/gcc/ipa-inline.c:2198 0x110910b execute ../../gcc-trunk/gcc/ipa-inline.c:2564 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. $ $ gcc-trunk -Os small.c small.c:36:1: internal compiler error: in remove_unreachable_nodes, at ipa.c:582 } ^ 0x91228d symbol_table::remove_unreachable_nodes(_IO_FILE*) ../../gcc-trunk/gcc/ipa.c:582 0x110910b ipa_inline ../../gcc-trunk/gcc/ipa-inline.c:2198 0x110910b execute ../../gcc-trunk/gcc/ipa-inline.c:2564 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. $ ------------------------- int a, b, c, d; struct S { int f0; }; static int fn1 (int p) { return p == 0 || a; } static int fn2 () { d = fn1 (c); return 0; } static int fn3 (struct S p) { p.f0 || fn2 (); if (fn1 (1)) b = 0; return 0; } int main () { struct S e = { 1 }; fn3 (e); return 0; }