delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/03/10/04:49:40

Sender: root AT hal DOT astr DOT lu DOT lv
Message-ID: <35050C39.88DDFFEF@acad.latnet.lv>
Date: Tue, 10 Mar 1998 11:47:38 +0200
From: Andris Pavenis <pavenis AT acad DOT latnet DOT lv>
Reply-To: pavenis AT acad DOT latnet DOT lv
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com, Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
Subject: Re: bug in gcc 2.8.0 (and 2.7.2)

>> This program is a feature test for perl. Compile this with -O0 and it
>> prints 0, but with -O2 it prints 1. This bug also appears on linux
>> (2.7.2.3).
>
>I don't have time to check this, but I have seen several reports on
>gnu news groups that seem to indicate there are some optimization-
>related bugs in GCC 2.8.0.  So I would suggest to report this to the
>GCC maintainers ASAP.  It is possible that this is solved in 2.8.1, in
>which case it is important for us to know (and port 2.8.1 as quickly
>as possible).

It is not solved in 2.8.1. I tested this under Linux (kernel 2.0.33, libc 5.4.44, etc) with both
gcc-2.8.1 anf pgcc-2.90.23(egcs 1.0.1). pgcc gave always 0, gcc-2.8.1 gave 1 with any optimizations
and 0 without them.

hal:~/test# gcc -v -O1 xxxx.c -o xxx
Reading specs from /usr/lib/gcc-lib/i586-pc-linux-gnulibc1/2.8.1/specs
gcc version 2.8.1
 /usr/lib/gcc-lib/i586-pc-linux-gnulibc1/2.8.1/cpp -lang-c -v -undef -D__GNUC__=2 -D__GNUC_MINOR__=8 -D__ELF__ -Dunix -Dlinux
-D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem(posix) -D__OPTIMIZE__ -Di386 -Di586 -Asystem(unix) -Acpu(i386)
-Amachine(i386) -D__i386__ -D__i586__ -Asystem(unix) -Acpu(i386) -Amachine(i386) xxxx.c /tmp/cca00145.i
GNU CPP version 2.8.1 (i386 GNU/Linux with ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/i586-pc-linux-gnulibc1/include
 /usr/lib/gcc-lib/i586-pc-linux-gnulibc1/2.8.1/include
 /usr/include
End of search list.
 /usr/lib/gcc-lib/i586-pc-linux-gnulibc1/2.8.1/cc1 /tmp/cca00145.i -quiet -dumpbase xxxx.c -O1 -version -o /tmp/cca00145.s
GNU C version 2.8.1 (i586-pc-linux-gnulibc1) compiled by GNU C version 2.8.1.
 as -V -Qy -o /tmp/cca001451.o /tmp/cca00145.s
GNU assembler version 980212 (i586-linux), using BFD version 2.8.1.0.21
 ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.1 -o xxx /usr/lib/crt1.o /usr/lib/crti.o
/usr/lib/gcc-lib/i586-pc-linux-gnulibc1/2.8.1/crtbegin.o -L/usr/lib/gcc-lib/i586-pc-linux-gnulibc1/2.8.1
-L/usr/i586-pc-linux-gnulibc1/lib /tmp/cca001451.o -lgcc -lc -lgcc /usr/lib/gcc-lib/i586-pc-linux-gnulibc1/2.8.1/crtend.o
/usr/lib/crtn.o
hal:~/test# ./xxx
1                      <----  So still bug with 2.8.1


With 'gcc xxxx.c -o xxx' I'm still getting 0

'gcc -V pgcc-2.90.23  -v -O6 xxxx.c -o xxx'  gives 0 (also with other
                            optimization levels)

With best regards

Andris Pavenis

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019