This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/44606] Wrong SPE floating point during computation
- From: "dvdkhlng at gmx dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 2 Nov 2010 14:39:40 +0000
- Subject: [Bug target/44606] Wrong SPE floating point during computation
- Auto-submitted: auto-generated
- References: <bug-44606-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44606
--- Comment #10 from David KÃhling <dvdkhlng at gmx dot de> 2010-11-02 14:39:12 UTC ---
I can reproduce this bug with gcc-4_4-branch SVN HEAD, compiling gcc in
cross-compile mode and running the resulting executable with qemu-ppc.
Instructions to reproduce everything without any PPC hardware involved (tested
on Ubuntu Maverick/AMD64):
Get a powerpcspe sysroot:
apt-cross -a powerpcspe -S sid -m http://ftp.de.debian.org/debian-ports \
libdb1-compat libdb4.8 libc6 libc6-dev linux-libc-dev \
zlib1g zlib1g-dev libmpfr-dev
apt-cross -a powerpcspe -S unreleased -m http://ftp.de.debian.org/debian-ports
\
libdb1-compat libdb4.8 libc6 libc6-dev linux-libc-dev \
zlib1g zlib1g-dev libmpfr-dev
(repeat a few times until all dependencies resolved)
get Debian SID binutils source, then compile&install in cross-compile mode:
dpkg-source -x binutils_*.dsc
cd binutils-* && \
TARGET=powerpcspe fakeroot debian/rules binary-cross
dpkg -i binutils-powepc-linux-gnuspe-*.deb
Get GCC from SVN and compile minimal C-only version:
svn co svn://gcc.gnu.org/svn/gcc/branches/gcc-4_4-branch
mkdir -p build
cd build && ../gcc-4_4-branch/configure \
--target=powerpc-linux-gnuspe \
-with-cpu=8548 --enable-e500_double --with-long-double-128 \
--enable-languages=c --disable-multilib \
--prefix=/usr --with-headers=/usr/powerpc-linux-gnuspe/include \
--with-libs=/usr/powerpc-linux-gnuspe/lib
make -C build -j5
Compile test-cases available as attachments to this bug, i.e. test.c:
build/gcc/xgcc \
-B./build/gcc/ -B/usr/powerpc-linux-gnuspe/bin/ \
-B/usr/powerpc-linux-gnuspe/lib/ \
-isystem /usr/powerpc-linux-gnuspe/include \
-isystem /usr/powerpc-linux-gnuspe/sys-include \
-fverbose-asm -dA -O2 -o test test.c
Use Ubuntu's qemu user-space emulation to run resulting executable:
rootfs=/usr/powerpc-linux-gnuspe
/usr/bin/qemu-ppc -cpu 'MPC8548E_v21' \
-E LD_LIBRARY_PATH=$rootfs/lib/ $rootfs/lib/ld.so.1 \
./test
Repeat the same with -O0 and note the difference. This test fails for all the
3 .c files attached here. Output for tc-resize.c matches the output documented
by Sebastian, so I'd say qemu is doing it right.