This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/44156] dot_product / matmul and signed zeros
- From: "dfranke at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 May 2010 23:49:28 -0000
- Subject: [Bug fortran/44156] dot_product / matmul and signed zeros
- References: <bug-44156-10391@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from dfranke at gcc dot gnu dot org 2010-05-17 23:49 -------
(In reply to comment #6)
> I already explained what dot_product is doing in comment #2.
> dot_product(a,b) is equivalent to
>
> s = 0
> do n = 1, m
> s = s + a(n) * b(n)
> end do
> (return s)
>
> For Thomas' code, you end up with 0 + (-0), which is 0 (which
> is what IEEE 754 explicitly says in Sec 8.3).
Thanks for the clarification.
Finally also found the c.l.f thread (where, btw, Tobias answers my question on
what other compilers do):
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/a693c3dd5f725e77
After reading it, I'd agree that this is probably a non-issue.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44156