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
tester.c
Description: Text Data
tester-O2.s
Description: Text document
|