This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: List of simplifications we should perform

Richard Earnshaw wrote:

> > Then it looks like a bug, since clearly
> >
> >       x + !!j != x + j
> >
> > Just consider j = 2

Dan replied:

> Likely.
> As I said, I just took the list from the comments, and verified 
> the rules they are printing out when they do each simplification 
> matches the comments (IE they print out what the simplifier is 
> doing), to avoid single typos that may have been made.

> Dunno if the simplifier is new to pro64, or if it's in the 7.x 
> compilers as well.

> If it's new to pro64, it would help explain why nobody's noticed 
> yet.

Well, it DTRT for me:

$ uname -a
IRIX bgwd73 6.5 04151556 IP32
$cat a.c
#include <stdio.h>

        int j = 2;
        printf("%d\n", !!j);
$ cc -v -O2 a.c
/usr/lib32/cmplrs/fec -G8 -DMIPSEB -D_MIPSEB -TENV:PIC -D_PIC -D__DSO__
-D_MODERN_C -D__sgi -D__host_mips -Amachine(mips) -D_SYSTYPE_SVR4
-D__unix -Asystem(unix) -D_COMPILER_VERSION=721 -m1 -O2 -show -D__mips=4
-TARG:abi=n32:isa=mips4 -TARG:proc=r5000 -I/usr/include
-FE:cmdline=/tmp/ctmL.AAAa007WQ -fB,/tmp/ctmB.BAAa007WQ a.c 
Compiling main 
/usr/lib32/cmplrs/be -PHASE:w:c -G8 -TENV:PIC -m1 -O2 -show
-TARG:abi=n32:isa=mips4 -TARG:proc=r5000 -LANG:=ansi_c
-TARG:t5_ll_sc_bug=on -fB,/tmp/ctmB.BAAa007WQ -fo,a.o a.c 
Compiling a.c (/tmp/ctmB.BAAa007WQ) -- Back End
Compiling main(0)

/usr/lib32/cmplrs/ld32 -call_shared -no_unresolved -transitive_link -elf
-_SYSTYPE_SVR4 -show -mips4 -n32 -L/usr/lib32/mips4/r5000
-L/usr/lib32/mips4 -L/usr/lib32 -nocount /usr/lib32/mips4/crt1.o -count
a.o -nocount -dont_warn_unused -Bdynamic -lc /usr/lib32/mips4/crtn.o
(null): INFO 152: /usr/lib32/cmplrs/ld32.
$ ./a.out

[ Note the -D_COMPILER_VERSION=721 ]

Toon Moene, KNMI, PO Box 201, 3730 AE De Bilt, The Netherlands.
Tel. +31302206443, Fax +31302210407,  e-mail

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]