linux-mips
[Top] [All Lists]

optimizer problem in linux-mips gcc-3.2?

To: gcc@gcc.gnu.org
Subject: optimizer problem in linux-mips gcc-3.2?
From: Guido Guenther <agx@sigxcpu.org>
Date: Sun, 26 Jan 2003 22:59:42 +0100
Cc: linux-mips@linux-mips.org
Mail-followup-to: Guido Guenther <agx@sigxcpu.org>, gcc@gcc.gnu.org, linux-mips@linux-mips.org
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.4i
Hi,
glibc's string/tester and string/inl-tester fail when compiled with
Debian's "gcc version 3.2.2 20030109 (Debian prerelease)" on linux-mips
(big endian) and -O2 or -Os. I've tried to strip down the testcase as
far as possible and suspect that gcc miscompiles it. It works fine with
Debian's "gcc version 2.95.4 20011002" and with the above gcc-3.2.2 and
optimations turned off, -O3 and -O1:

foo@bar:~$ gcc --save-temps -O2 tester.c && ./a.out
memccpy flunked test 8
0x10000100 is abcdefghr should be abcdefgh
1 errors.

foo@bar:~$ gcc --save-temps -Os tester.c && ./a.out 
memccpy flunked test 8
0x10000100 is abcdefghr should be abcdefgh
1 errors.

foo@bar:~$ gcc --save-temps -O3 tester.c && ./a.out 
0x10000100 is abcdefgh should be abcdefgh
No errors.

foo@bar:~$ gcc --save-temps -O0 tester.c && ./a.out 
0x10000100 is abcdefgh should be abcdefgh
No errors.

foo@bar:~$ gcc -O1 tester.c && ./a.out 
0x100000f0 is abcdefgh should be abcdefgh
No errors.

I've attache the testcase and the assembler output for -O2. Any help
greatly appreciated.
Regards,
 -- Guido

Attachment: tester.c
Description: Text Data

Attachment: tester-O2.s
Description: Text document

<Prev in Thread] Current Thread [Next in Thread>