public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ntysdd at qq dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/108068] New: decimal signed zero is not honored
Date: Mon, 12 Dec 2022 08:53:22 +0000	[thread overview]
Message-ID: <bug-108068-4@http.gcc.gnu.org/bugzilla/> (raw)

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

             reply	other threads:[~2022-12-12  8:53 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-12  8:53 ntysdd at qq dot com [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-108068-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).