public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: ada/5590: Float'Image unreliable with zero, Is_Negative intrisic to blame
@ 2003-05-10 21:36 Dara Hazeghi
  0 siblings, 0 replies; 3+ messages in thread
From: Dara Hazeghi @ 2003-05-10 21:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR ada/5590; it has been noted by GNATS.

From: Dara Hazeghi <dhazeghi@yahoo.com>
To: gcc-gnats@gcc.gnu.org, minyard@acm.org
Cc:  
Subject: Re: ada/5590: Float'Image unreliable with zero, Is_Negative intrisic to blame
Date: Sat, 10 May 2003 14:26:33 -0700

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit- 
 trail&database=gcc&pr=5590
 
 Hello,
 
 your PR indicates that the testcase failed on 3.1. Would it be possible  
 to test whether this problem still occurs on a more current version of  
 gcc (ie 3.2.3)? Thanks,
 
 Dara
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ada/5590: Float'Image unreliable with zero, Is_Negative intrisic to blame
@ 2003-05-12 11:27 giovannibajo
  0 siblings, 0 replies; 3+ messages in thread
From: giovannibajo @ 2003-05-12 11:27 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, minyard, nobody

Synopsis: Float'Image unreliable with zero, Is_Negative intrisic to blame

State-Changed-From-To: open->feedback
State-Changed-By: bajo
State-Changed-When: Mon May 12 11:19:15 2003
State-Changed-Why:
    See Dara's question.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5590


^ permalink raw reply	[flat|nested] 3+ messages in thread

* ada/5590: Float'Image unreliable with zero, Is_Negative intrisic to blame
@ 2002-02-04 11:07 minyard
  0 siblings, 0 replies; 3+ messages in thread
From: minyard @ 2002-02-04 11:07 UTC (permalink / raw)
  To: gcc-gnats


>Number:         5590
>Category:       ada
>Synopsis:       Float'Image unreliable with zero, Is_Negative intrisic to blame
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 04 11:06:22 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Corey Minyard <minyard@acm.org>
>Release:        Current gcc 3.1 tree
>Organization:
>Environment:
Linux/PPC
>Description:
I ran a test suite I had for Ada, and I only ran into one small problem. I've traced it down to the Is_Negative Ada intrinsic not working reliably when compiled with -O2.  It doesn't reliably work for zero, it sometimes detects 0.0 is -0.0, and sometimes vice versa (probably depends on the code around it).  This is just for PPC, for x86 it works fine.  I haven't done much more to track this down, and I don't know much about IEEE floating point, but the actual code for negative detection seems odd.  Why not just check the sign bit?



Should produce the following output:

Val: ' 0.00000E+00'
Val: ' 0.00000E+00'
Constant
Variable

On the PPC, it produces the following output:

Val: '0.00000E+00'   <= Notice there is no space here at the beginning
Val: '-0.00000E+00'
Constant
Is Negative 2 <= The value should not be negative.
Variable
Is Negative 2 <= The value should not be negative.

If you move things around and change things, the behaviour changes. 
>How-To-Repeat:
Compile and run the attached code under Linux/PPC, it produces:

Val: '0.00000E+00'   <= Notice there is no space here at the beginning
Val: '-0.00000E+00'
Constant
Is Negative 2 <= The value should not be negative.
Variable
Is Negative 2 <= The value should not be negative.

The output should be:

Val: ' 0.00000E+00'
Val: ' 0.00000E+00'
Constant
Variable
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="tester"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="tester"

CnBhY2thZ2UgU3lzdGVtLlRlc3RlcjNfWCBpcwoKICAgZnVuY3Rpb24gSXNfTmVnYXRpdmUgKFYg
OiBMb25nX0xvbmdfRmxvYXQpIHJldHVybiBCb29sZWFuOwogICBwcmFnbWEgSW1wb3J0IChJbnRy
aW5zaWMsIElzX05lZ2F0aXZlKTsKCmVuZCBTeXN0ZW0uVGVzdGVyM19YOwoKd2l0aCBBZGEuVGV4
dF9JTzsKdXNlIEFkYS5UZXh0X0lPOwp3aXRoIFN5c3RlbS5UZXN0ZXIzX1g7IHVzZSBTeXN0ZW0u
VGVzdGVyM19YOwoKcHJvY2VkdXJlIFRlc3RlcjMgaXMKICAgdmFsMiA6IEZsb2F0IDo9IDAuMDsK
ICAgVmFsIDogU3RyaW5nIDo9IEZsb2F0J0ltYWdlKFZhbDIpOwogICBwcm9jZWR1cmUgWDEoWCA6
IEZsb2F0KSBpcwogICBiZWdpbgogICAgICBpZiAoWCA8IDAuMCkgdGhlbgogICAgICAgICBQdXRf
TGluZSgiSXMgTmVnYXRpdmUgMSIpOwogICAgICBlbmQgaWY7CiAgICAgIGlmIChJc19OZWdhdGl2
ZShMb25nX0xvbmdfRmxvYXQoWCkpKSB0aGVuCiAgICAgICAgIFB1dF9MaW5lKCJJcyBOZWdhdGl2
ZSAyIik7CiAgICAgIGVuZCBpZjsKICAgZW5kIFgxOwpiZWdpbgogICBQdXRfTGluZSgiVmFsOiAn
IiAmIFZhbCAmICInIik7CiAgIFB1dF9MaW5lKCJWYWw6ICciICYgRmxvYXQnSW1hZ2UoMC4wKSAm
ICInIik7CiAgIFB1dF9MaW5lKCJDb25zdGFudCIpOwogICBYMSgwLjApOwogICBQdXRfTGluZSgi
VmFyaWFibGUiKTsKICAgWDEoVmFsMik7CmVuZCBUZXN0ZXIzOwo=


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-05-12 11:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-10 21:36 ada/5590: Float'Image unreliable with zero, Is_Negative intrisic to blame Dara Hazeghi
  -- strict thread matches above, loose matches on Subject: below --
2003-05-12 11:27 giovannibajo
2002-02-04 11:07 minyard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).