On two different architectures for Linux, gcc-4.0.2 appears to produce bad code when compiling the RC5 crypto test (crypto/rc5 in openssl) when using any level of optimization. Compiling the testcase with -O1, -O2, or -O3 will trigger the bug. -O0 allows the test to complete successfully. This is verified on 0.9.7i and 0.9.8a on Linux/Mips and Linux/S390. Linux/PPC32, Linux/x86_64, Linux/i386, and Linux/IA64 appear to be unaffected. Linux/Sparc, Arm, sh and others were not tested.
The primary testing system/environment was an SGI Octane running a 64bit Linux kernel on a 32bit userland environment, glibc-2.3.6, binutils-2.16.91.0.2. There already exists a bug in OpenSSL's bugs database regarding the issue: http://www.aet.tu-cottbus.de/rt2/Ticket/Display.html?id=1203 (May want a login, use the guest login). The attached testcase is a trimmed-down version of OpenSSL's RC5 test code used in the test phase of the build. -- Summary: gcc-4.0.{1,2} produces bad code for -O2 on OpenSSL RC5 Crypto Test Product: gcc Version: 4.0.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: kumba at gentoo dot org GCC build triplet: mips-unknown-linux-gnu GCC host triplet: mips-unknown-linux-gnu GCC target triplet: mips-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25437