public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/108068] New: decimal signed zero is not honored
@ 2022-12-12  8:53 ntysdd at qq dot com
  2022-12-12 16:54 ` [Bug tree-optimization/108068] [10/11/12/13 Regression] decimal floating point " pinskia at gcc dot gnu.org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: ntysdd at qq dot com @ 2022-12-12  8:53 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108068
           Summary: decimal signed zero is not honored
           Product: gcc
           Version: 12.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ntysdd at qq dot com
  Target Milestone: ---

This program has different behavior on different optimizing levels.

    #include <stdio.h>
    #include <decimal/decimal>

    int main()
    {
        std::decimal::decimal64 x;
        x = -1;
        while (x != 0)
        {
            x /= 10;
        }
        double d = decimal64_to_double(x);
        printf("%.0f\n", d);
    }


For example, on my current machine (gcc 9.4.0), it gives "-0" on O0, and "0" on
O1, then "-0" again on O2.

I believe it still has similar problems on 12.2

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

end of thread, other threads:[~2023-05-04  7:22 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-12  8:53 [Bug c/108068] New: decimal signed zero is not honored ntysdd at qq dot com
2022-12-12 16:54 ` [Bug tree-optimization/108068] [10/11/12/13 Regression] decimal floating point " pinskia at gcc dot gnu.org
2022-12-21 12:11 ` rguenth at gcc dot gnu.org
2022-12-21 15:08 ` jakub at gcc dot gnu.org
2022-12-21 15:45 ` jakub at gcc dot gnu.org
2022-12-21 17:37 ` joseph at codesourcery dot com
2022-12-21 17:53 ` jakub at gcc dot gnu.org
2022-12-22  7:12 ` rguenth at gcc dot gnu.org
2022-12-22 10:36 ` jakub at gcc dot gnu.org
2022-12-22 10:40 ` jakub at gcc dot gnu.org
2022-12-22 11:36 ` rguenther at suse dot de
2022-12-23 15:22 ` cvs-commit at gcc dot gnu.org
2022-12-23 15:23 ` [Bug tree-optimization/108068] [10/11/12 " jakub at gcc dot gnu.org
2023-02-10 17:45 ` cvs-commit at gcc dot gnu.org
2023-02-10 17:58 ` [Bug tree-optimization/108068] [10/11 " jakub at gcc dot gnu.org
2023-05-02 20:13 ` cvs-commit at gcc dot gnu.org
2023-05-03  9:33 ` [Bug tree-optimization/108068] [10 " jakub at gcc dot gnu.org
2023-05-03 15:20 ` cvs-commit at gcc dot gnu.org
2023-05-04  7:22 ` jakub at gcc dot gnu.org

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).