This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c/8395: gcc 2.95.4 and 3.2 generate wrong code for double on intel
- From: bernardo at sti dot uniurb dot it
- To: gcc-gnats at gcc dot gnu dot org
- Date: 30 Oct 2002 08:19:08 -0000
- Subject: c/8395: gcc 2.95.4 and 3.2 generate wrong code for double on intel
- Reply-to: bernardo at sti dot uniurb dot it
>Number: 8395
>Category: c
>Synopsis: gcc 2.95.4 and 3.2 generate wrong code for double on intel
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Wed Oct 30 00:26:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Marco Bernardo
>Release: gcc 2.95.4 and 3.2
>Organization:
>Environment:
intel processor (pentium 4), Linux Debian 2.4.16
>Description:
Expressions containing occurrences of double variables
are wrongly translated, especially when negative values
are involved.
The problem disappears when using long double instead
of double.
In the attached program, the value of the expression
should be 0. This is the case with long double, whereas
its value is -2.22045e-16 with double.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-csrc; name="prova.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="prova.c"
I2luY2x1ZGUgPHN0ZGlvLmg+CmludCBtYWluKHZvaWQpCnsKCWRvdWJsZSB4LCB5LCB6OwoJbG9u
ZyBkb3VibGUgbHgsIGx5LCBsejsKCgl4ID0gLTYuMDsKCXkgPSAtMS4yOwoJeiA9IDU7Cglwcmlu
dGYoIiVnICVnICVnICVnXG4iLAoJICAgICAgIHgsCgkgICAgICAgeSwKCSAgICAgICB6LAoJICAg
ICAgIHggLSB5ICogeik7CglseCA9IC02LjBMOwoJbHkgPSAtMS4yTDsKCWx6ID0gNUw7Cglwcmlu
dGYoIiVMZyAlTGcgJUxnICVMZ1xuIiwKCSAgICAgICBseCwKCSAgICAgICBseSwKCSAgICAgICBs
eiwKCSAgICAgICBseCAtIGx5ICogbHopOwoJcmV0dXJuKDApOwp9Cg==