gcc 4.2 branch and gcc 4.3 SVN snapshot seems to miscompile MPlayer's mp_msg.c resulting in a crash. gcc 3.4.6 is ok. During compilation no warning is issued.
Gcc tested is : Using built-in specs. Target: i686-pc-linux-gnu Configured with: ../gcc/configure --prefix=/home/cartman/gcc_4.2 --enable-clocale=gnu --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-languages=c,c++ --disable-nls Thread model: posix gcc version 4.2.0 20061217 (prerelease) I will attach two files: mp_msg_compiled_with_O1_crashes.i produced with : cc -O1 -Wdeclaration-after-statement -march=pentium-m -mtune=pentium-m -pipe -ffast-math -fomit-frame-pointer -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -I/usr/include -I/usr/include/ -I/usr/include/SDL -D_REENTRANT -I/usr/include -I/usr/include/dvdnav -I/usr/include/freetype2 -I. -I./libavutil -I./libavcodec -c -save-temps mp_msg.c mp_msg_compiled_with_O0_works.i produced with: cc -O0 -Wdeclaration-after-statement -march=pentium-m -mtune=pentium-m -pipe -ffast-math -fomit-frame-pointer -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -I/usr/include -I/usr/include/ -I/usr/include/SDL -D_REENTRANT -I/usr/include -I/usr/include/dvdnav -I/usr/include/freetype2 -I. -I./libavutil -I./libavcodec -c -save-temps mp_msg.c -- Summary: [4.2/4.3] Gcc miscompiles MPlayer when any optimization is used Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: ismail at pardus dot org dot tr http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30247