This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/39034] Decimal floating-point math done wrong
- From: "janis at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Jan 2009 20:44:56 -0000
- Subject: [Bug c/39034] Decimal floating-point math done wrong
- References: <bug-39034-17245@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from janis at gcc dot gnu dot org 2009-01-30 20:44 -------
Created an attachment (id=17214)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17214&action=view)
expanded testcase
I expanded the testcase to test both constant folding and runtime calculations
for all three decimal float types.
The problem occurs with 4.3.3 but not with mainline. I can track down the
patch that fixed it if anyone is interested.
Test results for trunk and 4.3 for powerpc64-linux and x86-linux (bid and dpd):
elm3b187% uname -m
ppc64
elm3b187% /opt/gcc-nightly/trunk/bin/gcc -DDBG -O2 -std=gnu99 39034.c &&
./a.out
elm3b187% /opt/gcc-nightly/4.3/bin/gcc -DDBG -O2 -std=gnu99 39034.c && ./a.out
line 29: runtime: d32 should be zero
line 42: runtime: d64 should be zero
line 56: runtime: d128 should be zero
Aborted
laptop% uname -m
i686
laptop% /home/janis/tools/gcc-trunk-bid/bin/gcc -DDBG -O2 -std=gnu99 39034.c &&
./a.out
laptop% /home/janis/tools/gcc-trunk-dpd/bin/gcc -DDBG -O2 -std=gnu99 39034.c &&
./a.out
laptop% /home/janis/tools/gcc-4.3.3-bid/bin/gcc -DDBG -O2 -std=gnu99 39034.c &&
./a.out
line 29: runtime: d32 should be zero
line 42: runtime: d64 should be zero
line 56: runtime: d128 should be zero
Aborted (core dumped)
laptop% /home/janis/tools/gcc-4.3.3-dpd/bin/gcc -DDBG -O2 -std=gnu99 39034.c &&
./a.out
line 29: runtime: d32 should be zero
line 42: runtime: d64 should be zero
line 56: runtime: d128 should be zero
Aborted (core dumped)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39034