floating point operations in gcc 3.3.3, glibc 2.3.2

Dan Kegel dank@kegel.com
Wed Jun 23 10:45:00 GMT 2004


Kunjan Naik wrote:
> Target: ppc750
> Toolchain 1: crosstool-0.28-rc19, gcc3.3.3 glibc-2.3.2
> Toolchain 2: crosstool-0.28-rc19, gcc3.3.3 glibc-2.3.2 without
> gcc-3.3.2-arm-softfloat.patch
> Sample Testcase: modified struct-ret-1.c with printf statements (see
> attached)
> Complier flag: --static.
> 
> Both the toolchains output the same .s file for the testcase. 
> When executed on target, toolchain 1 binary prints garbage and toolchain 2
> binary prints expected output.
> For toolchain 1, the testcase compares garbage values and succeeds or aborts
> and for toolchain 2 the testcase
> compares valid output and always succeeds.

I just wrote a shell script to try to reproduce your result.
Before running it, I copied patches/gcc-3.3.3/gcc-3.3.2-arm-softfloat.patch
to the contrib directory, and put a copy of your struct-ret-1.c in the
current directory.
Does this look right?

#!/bin/sh
set -ex
TARBALLS_DIR=$HOME/downloads
export TARBALLS_DIR
GCC_LANGUAGES="c"
export GCC_LANGUAGES
RESULT_TOP=/opt/crosstool/xxvfp
export RESULT_TOP
mkdir -p $RESULT_TOP
cp contrib/gcc-3.3.2-arm-softfloat.patch patches/gcc-3.3.3
eval `cat powerpc-750.dat gcc-3.3.3-glibc-2.3.2.dat`  sh all.sh --notest
RESULT_TOP=/opt/crosstool/novfp
export RESULT_TOP
mkdir -p $RESULT_TOP
rm -f patches/gcc-3.3.3/gcc-3.3.2-arm-softfloat.patch
eval `cat powerpc-750.dat gcc-3.3.3-glibc-2.3.2.dat`  sh all.sh --notest
/opt/crosstool/xxvfp/powerpc-750-linux-gnu/gcc-3.3.3-glibc-2.3.2/bin/powerpc-750-linux-gnu-gcc -static struct-ret-1.c -o xxvfp.out
/opt/crosstool/novfp/powerpc-750-linux-gnu/gcc-3.3.3-glibc-2.3.2/bin/powerpc-750-linux-gnu-gcc -static struct-ret-1.c -o novfp.out
cmp xxvfp.out novfp.out
echo Finished

It does say that xxvfp.out and novfp.out differ, but if you run
$ cmp -l xxvfp.out novfp.out
you will see that the only differences are that 'no' has been
replaced with 'xx'.  Thus I doubt that the two programs will
behave differently.  I can send them to you if you like, but
perhaps you should run this shell script yourself and report
back the results.

- Dan


-- 
My technical stuff: http://kegel.com
My politics: see http://www.misleader.org for examples of why I'm for regime change

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com



More information about the crossgcc mailing list