https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80692

            Bug ID: 80692
           Summary: _Decimal64 -0 != 0 unless optimization is turned off
           Product: gcc
           Version: 7.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sisyphus1 at optusnet dot com.au
  Target Milestone: ---

Created attachment 41334
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41334&action=edit
C program exhibits bug if compiled with optimization

Hi,

The attached program is fine if compiled without any optimization.
Otherwise it indicates that a variable holding the value -0.DD is not equal to
0.DD, though still accepts that -0.DD == -0.DD.

This happens on MS Windows (for a range of gcc versions from 4.7.0 through to
7.1.0).
On Linux (Ubuntu 16.04) I have tested only with gcc-5.4.0 where the same
behaviour occurs.

I haven't struck a gcc compiler that supports decimal floats but doesn't
exhibit the same behaviour.

The _Decimal128 type is similarly afflicted - I haven't checked _Decimal32.

Cheers,
Rob

Reply via email to