This is the mail archive of the gcc-bugs@gcc.gnu.org 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: optimization/1762, please reopen


Hello again.

On 25 Jun, Richard Henderson wrote:
> On Mon, Jun 25, 2001 at 08:39:11PM +0200, Reichelt wrote:
>> I still get the wrong results with the code snippet from the PR.
>> But it's target specific (maybe I should have mentioned that more
>> explicitly): On an x86-linux machine everything works fine
>> (return value "0"), but on the SGI I get "1" instead.
>> 
>> Did you check it on an SGI?
> 
> Yes.
> 
> $ ./cc1 -quiet -v -O z.c
> GNU CPP version 3.0.1 20010622 (prerelease) (cpplib) [AL 1.1, MM 40] SGI running IRIX 6.x
> ignoring nonexistent directory "/usr/local/include"
> ignoring nonexistent directory "..."
> ignoring nonexistent directory "..."
> #include "..." search starts here:
> #include <...> search starts here:
>  /usr/include
> End of search list.
> $ gcc z.s
> $ ./a.out
> $ echo $?
> 0
> $ uname -a
> IRIX ada 6.3 12161207 IP32
> 
> So.  What are you doing differently?

I took me a while to find out, but apparently it's a matter of mips3
or mips4 (with mips4 generating the wrong code):

$ gcc -mips4 -mabi=n32 -O NaNBug1762.c; ./a.out; echo $?
1
$ gcc -mips3 -mabi=n32 -O NaNBug1762.c; ./a.out; echo $?
ld32: WARNING 158: Expecting MIPS3 objects: /usr/LOCAL/lib/gcc-lib/mips-sgi-irix6.5/3.0/crtbegin.o is MIPS4.
0

I'm using IRIX 6.5 and the default configuration is mips4.
You seem to be using IRIX 6.3. Maybe your default configuration is
mips3? The assembler files show the following differences:

$ diff -c MIPS3.s MIPS4.s
*** MIPS3.s     Tue Jun 26 13:31:38 2001
--- MIPS4.s     Tue Jun 26 13:31:56 2001
***************
*** 26,36 ****
        daddu   $gp,$1,$25
        .set    at
        dmtc1   $0,$f0
!       c.lt.d  $f12,$f13
        #nop
!       bc1f    .L3
!       l.d     $f0,.LC0
! .L3:
        ld      $28,16($sp)
        #nop
        .set    noreorder
--- 26,35 ----
        daddu   $gp,$1,$25
        .set    at
        dmtc1   $0,$f0
!       c.le.d  $f13,$f12
!       l.d     $f1,.LC0
        #nop
!       movf.d  $f0,$f1,$fcc0
        ld      $28,16($sp)
        #nop
        .set    noreorder

Greetings,
Volker

MIPS3.s.gz

MIPS4.s.gz


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