http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50588
Bug #: 50588 Summary: gcc produce bad inlined code with -march=athlon -O2 Classification: Unclassified Product: gcc Version: 4.6.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassig...@gcc.gnu.org ReportedBy: news...@duradsl.dyndns.org Created attachment 25394 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25394 Reduced example that trigger the bug When the attached file (which is a reduced testcase from inetutils traceroute.c) is compiled with -march=athlon -O2, the resulting binary segfault: gcc -march=athlon -O2 -o traceroute traceroute.c ./traceroute Before Segmentation fault When inlining is disabled, no problem: gcc -march=athlon -O2 -fno-inline -o traceroute traceroute.c ./traceroute Before After The problem can be reproduced on athlon-xp and core2 machines with 32 bits libs. gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-pc-linux-gnu/4.6.1/lto-wrapper Target: i686-pc-linux-gnu Configured with: ../gcc-4.6.1/configure --prefix=/usr --libexecdir=/usr/lib --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-languages=c,c++ --disable-multilib --disable-bootstrap --with-system-zlib Thread model: posix gcc version 4.6.1 (GCC)