This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: rs6000 patch for logical operation cleanup.
Am Fri, 19 May 2000 schrieb Geoff Keating:
> > cc: gcc-patches@gcc.gnu.org, gcc-bugs@gcc.gnu.org
> > Date: Fri, 19 May 2000 13:49:03 -0400
> > From: David Edelsohn <dje@watson.ibm.com>
> >
> > How can we solve this once and for all so that it is not reverted
> > again?
>
> by writing something like
>
> if (HOST_BITS_PER_WIDE_INT < GET_MODE_SIZE (mode)
> && INTVAL (x) < 0)
> return 0;
>
> and _adding the testcase_ so that when in future someone changes this
> code, and gets it wrong, they know about it. This is the only
> guaranteed way to fix a bug.
Heh, I just found another slight bug in the new logical operation code while
bootstrapping current CVS on powerpc-linux-gnu:
[root@enzo:/cvsx/obj/gccmnp/gcc]# stage1/xgcc -Bstage1/
-B/cvsx/gnubinnp/ppc-redhat-linux/bin/ -c -DIN_GCC -W -Wall -Wtraditional
-pedantic -Wno-long-long -Wwrite-strings -g -O2 -DHAVE_CONFIG_H -I.
-I../../../gccmnp/gcc -I../../../gccmnp/gcc/config
-I../../../gccmnp/gcc/../include ../../../gccmnp/gcc/loop.c -v -save-temps
-fverbose-asm -dp
Reading specs from stage1/specs
gcc version 2.96 20000519 (experimental)
stage1/cpp -lang-c -v -I. -I../../../gccmnp/gcc -I../../../gccmnp/gcc/config
-I../../../gccmnp/gcc/../include -iprefix
stage1/../lib/gcc-lib/ppc-redhat-linux/2.96/ -isystem
/cvsx/gnubinnp/ppc-redhat-linux/bin/include -isystem include -isystem
stage1/include -D__GNUC__=2 -D__GNUC_MINOR__=96 -D__GNUC_PATCHLEVEL__=0 -DPPC
-D__ELF__ -Dpowerpc -D__PPC__ -D__ELF__ -D__powerpc__ -D__PPC -D__powerpc
-Acpu(powerpc) -Amachine(powerpc) -D__CHAR_UNSIGNED__ -D__OPTIMIZE__ -g
-W -Wall -Wtraditional -Wno-long-long -Wwrite-strings -pedantic -dp
-D_CALL_SYSV -D_BIG_ENDIAN -D__BIG_ENDIAN__ -Amachine(bigendian) -D_ARCH_PPC
-D__unix__
-D__linux__ -Dunix -D__unix -Dlinux -D__linux -Asystem(unix) -Asystem(posix)
-DIN_GCC -DHAVE_CONFIG_H ../../../gccmnp/gcc/loop.c loop.i
GNU CPP version 2.96 20000519 (experimental) (cpplib)
(PowerPC GNU/Linux)
ignoring nonexistent directory `/cvsx/gnubinnp/ppc-redhat-linux/bin/include'
ignoring nonexistent directory `stage1/include'
ignoring nonexistent directory `lib/gcc-lib/ppc-redhat-linux/2.96/include'
ignoring nonexistent directory `ppc-redhat-linux/include'
ignoring nonexistent directory `/usr/local/include'
ignoring nonexistent directory
`/cvsx/gnubinnp/lib/gcc-lib/ppc-redhat-linux/2.96/include'
ignoring nonexistent directory `/cvsx/gnubinnp/ppc-redhat-linux/include'
#include "..." search starts here:
#include <...> search starts here:
.
../../../gccmnp/gcc
../../../gccmnp/gcc/config
../../../gccmnp/include
include
/usr/include
End of search list.
stage1/cc1 loop.i -quiet -dumpbase loop.c -dp -g -O2 -W -Wall -Wtraditional
-Wno-long-long -Wwrite-strings -pedantic -version -fverbose-asm -o loop.s
GNU C version 2.96 20000519 (experimental) (ppc-redhat-linux) compiled by GNU
C version 2.95.3 19991030 (prerelease/franzo).
../../../gccmnp/gcc/loop.c: In function `strength_reduce':
../../../gccmnp/gcc/loop.c:4538: warning: comparison between signed and
unsigned
../../../gccmnp/gcc/loop.c:4544: warning: comparison between signed and
unsigned
../../../gccmnp/gcc/loop.c: In function `load_mems':
../../../gccmnp/gcc/loop.c:9848: warning: comparison between signed and
unsigned
as -mppc -V -Qy -o loop.o loop.s
GNU assembler version 2.9.5 (ppc-redhat-linux) using BFD version 2.9.5.0.41
loop.s: Assembler messages:
loop.s:14837: Error: Unrecognized opcode: `andi'
This should be "andi.", the code in loop.s looks like:
.LM2231:
lwz 0,12(1) # 7955 *movsi_got_internal+1/3 [length = 4]
mr 3,16 # 4762 *movsi_got_internal+1/1 [length = 4]
mr 4,26 # 4764 *movsi_got_internal+1/1 [length = 4]
andi 5,0,1 # 4766 *boolsi3_internal1/2 [length = 4]
bl recombine_givs # 4767 *call_local32/1 [length = 4]
.stabn 68,0,4639,.LM2232-strength_reduce
I looked at the boolsi3_internal1 and saw no easy way to fix that without
breaking "ori" and "xori", which don't allow the dot.
Franz.