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: "kargl at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 May 2010 16:19:19 -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 #1 from kargl at gcc dot gnu dot org 2010-05-16 16:19 -------
The generated code is fine. The F2003 standard states on page 38.
The real type includes a zero value. Processors that distinguish between
positive and negative zeros shall treat them as equivalent
(1) in all relational operations,
(2) as actual arguments to intrinsic procedures other than those
for which it is explicitly specified that negative zero is
distinguished, and
MATMAL and DOT_PRODUCT are not in the list that (2) applies to.
Remove wrong-code keyword.
Change Severity to enhancement, because might try to argue that this
is a Quality of Implementation issue. I'll leave it to Thomas to
decide whether to close as WONTFIX.
PS: DOT_PRODUCT is in-lined. -ftree-dump-original shows
val.2 = 0.0;
{
integer(kind=4) S.3;
S.3 = 1;
while (1)
{
if (S.3 > 1) goto L.1;
val.2 = a[S.3 + -1] * b[S.3 + -1] + val.2;
S.3 = S.3 + 1;
}
L.1:;
}
D.1505 = val.2;
Even if a[S.3 + -1] * b[S.3 + -1] = -0. The accumulation of the
sum -0 + 0 in the above will result in 0 (without the sign).
--
kargl at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|minor |enhancement
Keywords|wrong-code |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44156