This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: An x86 -fpic and -fomit-frame-pointer bug
- To: hjl at lucon dot org
- Subject: Re: An x86 -fpic and -fomit-frame-pointer bug
- From: Manfred Hollstein <manfred at s-direktnet dot de>
- Date: Sun, 21 Jun 1998 15:23:50 +0200 (MEST)
- Cc: john at feith dot com, law at cygnus dot com, egcs-bugs at cygnus dot com
- References: <13707.59493.240324.923010@saturn.hollstein.net><m0ynVZD-00026CC@ocean.lucon.org>
- Reply-To: manfred at s-direktnet dot de, Manfred dot Hollstein at ks dot sel dot alcatel dot de
On Sat, 20 June 1998, 14:52:59, hjl@lucon.org wrote:
> >
> > On Mon, 15 June 1998, 23:14:14, hjl@lucon.org wrote:
> >
> > > Hi,
> > >
> > > Here is a test case for an x86 -fpic and -fomit-frame-pointer bug.
> > > cexp.cc is miscompiled by -fpic and -fomit-frame-pointer. Basically
> > > ebx saved on the stack is overriden by
> > >
> > > fstpl (%esp)
> > >
> > > Later,
> > >
> > > popl %ebx
> > >
> > > put some garbage in ebx. Without -fpic or -fomit-frame-pointer, cexp.s
> > > is compiled fine.
> > >
> > > BTW, egcs 1.0.3 is ok. The last working egcs 1.1 is 971215 and 971225
> > > has the same bug.
> >
> > H.J., your example is incomplete; the file "cexp.h" is missing!
> >
>
> It shows you are the only one who ever tried my testcase :-). Here
> is the complete testcase.
Thanks. BUT, egcs-1.0.3a is buggy, too:
$ LD_RUN_PATH=/tools/gnu/lib/gcc-lib/i586-linux/egcs-2.91.41 gmake CC=/tools/gnu/packages/egcs/19980620/bin/gcc
/tools/gnu/packages/egcs/19980620/bin/gcc -S -O2 -fno-exceptions main.cc
/tools/gnu/packages/egcs/19980620/bin/gcc -S -fomit-frame-pointer -O3 -fpic -fno-exceptions cexp.cc
/tools/gnu/packages/egcs/19980620/bin/gcc -o main main.s cexp.s -lstdc++
for f in main; do echo "Running: $f"; $f; \
if [ $? != 0 ]; then echo Failed; fi; done
Running: main
Failed
$ LD_RUN_PATH=/tools/gnu/lib/gcc-lib/i586-linux/egcs-2.90.29 gmake CC=/tools/gnu/packages/egcs/1.0.3a/bin/gcc
/tools/gnu/packages/egcs/1.0.3a/bin/gcc -S -O2 -fno-exceptions main.cc
/tools/gnu/packages/egcs/1.0.3a/bin/gcc -S -fomit-frame-pointer -O3 -fpic -fno-exceptions cexp.cc
/tools/gnu/packages/egcs/1.0.3a/bin/gcc -o main main.s cexp.s -lstdc++
for f in main; do echo "Running: $f"; $f; \
if [ $? != 0 ]; then echo Failed; fi; done
Running: main
Failed
$ make clean
Interestingly, gcc-2.8.1 is OK:
$ LD_RUN_PATH=/tools/gnu/lib/gcc-lib/i586-linux/2.8.1 gmake CC=/tools/gnu/packages/gcs/2.8.1/bin/gcc
/tools/gnu/packages/gcs/2.8.1/bin/gcc -S -O2 -fno-exceptions main.cc
/tools/gnu/packages/gcs/2.8.1/bin/gcc -S -fomit-frame-pointer -O3 -fpic -fno-exceptions cexp.cc
/tools/gnu/packages/gcs/2.8.1/bin/gcc -o main main.s cexp.s -lstdc++
for f in main; do echo "Running: $f"; $f; \
if [ $? != 0 ]; then echo Failed; fi; done
Running: main
22.1672, 1.04274
manfred