From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CC6BD38369C4; Mon, 12 Dec 2022 08:53:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CC6BD38369C4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1670835202; bh=rbUHoFSsoERgCNC9/eMfDvEZqIQGIPIjvYK44ZGvyFk=; h=From:To:Subject:Date:From; b=Aqsdnvh/NPprEOLRvekRYlPx6oCujdJagzq14ALgOwEedC6lI1yu/Zw9Kts59nA91 wLz2e8D2gXOclNxwfhLnOo5eOpdONQ9b4dFs9Cq8Im9miq9tJw+tUAEzlKb2vI2+RM m7Ycy0UyFGvX7/NWK+qiffTcwIGzUA30ZGrno4f0= From: "ntysdd at qq dot com" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ntysdd at qq dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108068 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 #include int main() { std::decimal::decimal64 x; x =3D -1; while (x !=3D 0) { x /=3D 10; } double d =3D 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=