gcc-3.3 branch miscompiles libmcrypt-2.5.5/modules/algorithms/cast-256.c with -O2 Using -O1 works. make check fails: Algorithm: cast-256... failed compatibility Expected: 5db4dd765f1d3835615a14afcb5dc2f5 Got: 5944c34942d241e42814575ac5da8404 Modes: cbc: failed cfb: failed ctr: failed ecb: failed ncfb: failed nofb: failed ofb: failed Algorithm: cast-256... failed compatibility Expected: 5db4dd765f1d3835615a14afcb5dc2f5 Got: a4851815627314e950b04aa86f183c50 Reading specs from /usr/lib/gcc-lib/powerpc-suse-linux/3.3/specs Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib --enable-languages=c,c++,f77,objc,java --disable-checking --enable-libgcj --with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib --with-system-zlib --enable-shared --enable-__cxa_atexit powerpc-suse-linux Thread model: posix gcc version 3.3 20030215 (prerelease) (SuSE Linux) /usr/lib/gcc-lib/powerpc-suse-linux/3.3/cc1 -E -quiet -v -I. -I. -I../.. -I. -I../.. -I../../lib -MD cast-256.d -MF .deps/cast-256.Tpo -MP -MT cast-256.lo -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=0 -D__PIC__=2 -D__pic__=2 -D__unix__ -D__gnu_linux__ -D__linux__ -Dunix -D__unix -Dlinux -D__linux -Asystem=unix -Asystem=posix -DHAVE_CONFIG_H -DPIC cast-256.c -fsigned-char -fPIC -O1 cast-256.i ignoring duplicate directory "." ignoring duplicate directory "." ignoring duplicate directory "../.." #include "..." search starts here: #include <...> search starts here: . ../.. ../../lib /usr/local/include /usr/lib/gcc-lib/powerpc-suse-linux/3.3/include /usr/powerpc-suse-linux/include /usr/include End of search list. /usr/lib/gcc-lib/powerpc-suse-linux/3.3/cc1 -fpreprocessed cast-256.i -quiet -dumpbase cast-256.c -auxbase cast-256 -O1 -version -fsigned-char -fPIC -o cast-256.s GNU C version 3.3 20030215 (prerelease) (SuSE Linux) (powerpc-suse-linux) compiled by GNU C version 3.3 20030215 (prerelease) (SuSE Linux). /usr/lib/gcc-lib/powerpc-suse-linux/3.3/../../../../powerpc-suse-linux/bin/as -mppc -V -Qy -K PIC -o cast-256.o cast-256.s GNU assembler version 2.13.90.0.18 (powerpc-suse-linux) using BFD version 2.13.90.0.18 20030121 (SuSE Linux) Release: gcc version 3.3 20030215 (prerelease) (SuSE Linux) Environment: glibc 2.3.1cvs 20030213, binutils 2.13.90.0.18
Fix: http://gcc.gnu.org/ml/gcc-patches/2003-03/msg00549.html Not necessarily the correct fix, but highlights the problem.
Responsible-Changed-From-To: unassigned->dje Responsible-Changed-Why: PowerPC
State-Changed-From-To: open->analyzed State-Changed-Why: strength reduction bug
From: Janis Johnson <janis187@us.ibm.com> To: gcc-gnats@gcc.gnu.org, dje@gcc.gnu.org, gcc-bugs@gcc.gnu.org, olh@suse.de, gcc-prs@gcc.gnu.org Cc: Subject: Re: optimization/9745: gcc-3_3-branch miscompiles libmcrypt, native powerpc-linux Date: Mon, 24 Feb 2003 16:11:56 -0800 This regression shows up starting with a huge patch that David S. Miller <davem@redhat.com> added on 2002-06-11 to "Delete SEQUENCE rtl usage outside of reorg and ssa passes". (The ChangeLog entry gives the incorrect date.) http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9745
*** Bug 11319 has been marked as a duplicate of this bug. ***
Created attachment 4280 [details] Smaller example from pr11319 Here is a smaller example that has the problem, it comes from PR11319 which marcus@jet.franken.de filed.
10021 contains a patch which apparently fixes at least my testcase.
discussion about this bug: http://gcc.gnu.org/ml/gcc/2003-07/msg00088.html
Created attachment 4367 [details] loop_regs_update patch for aliasing problems A new proposed patch which may be a better replacement for my earlier alias.c find_base_value patch.
Subject: Bug 9745 CVSROOT: /cvs/gcc Module name: gcc Changes by: wilson@gcc.gnu.org 2003-07-11 06:44:41 Modified files: gcc : ChangeLog loop.c Log message: PR optimization/9745 * loop.c (loop_iv_add_mult_emit_before): Call loop_regs_update before loop_insn_emit_before. (loop_iv_add_mult_sink, loop_iv_add_mult_hoist): Likewise. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.451&r2=2.452 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/loop.c.diff?cvsroot=gcc&r1=1.462&r2=1.463
Subject: Bug 9745 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_3-branch Changes by: wilson@gcc.gnu.org 2003-07-11 06:47:05 Modified files: gcc : ChangeLog loop.c Log message: PR optimization/9745 * loop.c (loop_iv_add_mult_emit_before): Call loop_regs_update before loop_insn_emit_before. (loop_iv_add_mult_sink, loop_iv_add_mult_hoist): Likewise. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.648&r2=1.16114.2.649 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/loop.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.433.2.7&r2=1.433.2.8
loop.c patch checked in mainline and 3.3 branch.