From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7CBA93858031; Tue, 12 Jan 2021 16:35:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7CBA93858031 From: "ppalka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/98384] [11 Regression] new test case 20_util/to_chars/long_double.cc in r11-6249 fails on powerpc64 BE Date: Tue, 12 Jan 2021 16:35:22 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ppalka at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ppalka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2021 16:35:22 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98384 --- Comment #8 from Patrick Palka --- (In reply to ro@CeBiTec.Uni-Bielefeld.DE from comment #7) > > --- Comment #6 from Patrick Palka --- > [...] > > Thanks for testing! Hmm, that execute failure is surprising. I wonder= just > > how much we're diverging from the output of printf here. If possible, = could > > you let me know the value of the locals 'to_chars_buffer', 'printf_buff= er', > > 'precision' and 'testcase' (ideally in hex form) at the point of the as= sertion > > failure? >=20 > I'm seeing exactly the same failure mode on Solaris, both sparc and x86: > 32-bit compilation PASSes, execution XFAILed, 64-bit compilation PASSes, > too, but execution FAILs with the same assertion failure. >=20 > Here's what gdb prints for those variables (with the test compiled with > -g3 -O0 where the assertion still fails): >=20 > (gdb) p to_chars_buffer > $1 =3D "f.", 'f' , "ep+5380", '\000' > (gdb) p printf_buffer > $2 =3D "0x1.", 'f' , "cp+5383", '\000' > (gdb) p precision > No symbol "precision" in current context. > (gdb) p testcase > $3 =3D 5.56540347525605847154e+1620 > (gdb) p/x testcase > $5 =3D 0x7fffffffffffffff Thanks for this helpful info.=20 >>From what I can tell, the difference in output here is basically harmless. = The two hexadecimal forms (in to_chars_buffer and printf_buffer) are equivalent, though ours is one digit shorter. Both hexadecimal forms are also valid results of printf's %La specifier for this value. Since the standard underspecifies the result of printf's %a specifier, and since there's apparent implementation divergence, we shouldn't be verifying= the hex output of std::to_chars by comparing it with that of printf. Instead we should compare with the known correct value, or perhaps verify that applying std::from_chars on the output yields the original value.=