From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CE5A238708D9; Wed, 24 Feb 2021 15:14:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CE5A238708D9 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: Wed, 24 Feb 2021 15:14:19 +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: P1 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: Wed, 24 Feb 2021 15:14:19 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98384 --- Comment #13 from Patrick Palka --- (In reply to ro@CeBiTec.Uni-Bielefeld.DE from comment #12) > > --- Comment #11 from Patrick Palka --- > > I posted a patch at > > https://gcc.gnu.org/pipermail/gcc-patches/2021-February/565726.html tha= t does > > this, but also salvages the verification via printf by first checking i= f the > > leading hex digit of the printf output agrees with that of to_chars.=20 > > Conveniently, the patch sidesteps the question of choosing a consistent > > representation vs shortest representation :) >=20 > I've just tested the patch on both i386-pc-solaris2.11 and > sparc-sun-solaris2.11 (32 and 64-bit each): as before, the 32-bit test > XFAILs while the 64-bit test continues to FAIL: >=20 > before: >=20 > /vol/gcc/src/hg/master/local/libstdc++-v3/testsuite/20_util/to_chars/ > long_double.cc:104: void test01(): Assertion '!strcmp(to_chars_buffer, > printf_buffer+strlen("0x"))' failed. >=20 > now: >=20 > /vol/gcc/src/hg/master/local/libstdc++-v3/testsuite/20_util/to_chars/ > long_double.cc:192: void test02(): Assertion '!memcmp(printf_buffer, > to_chars_buffer, output_length)' failed. Thanks for testing. I was able to reproduce the 64-bit execution FAIL on sparc-sun-solaris2.11 (using the gcc211 compile farm machine). Digging deeper, it seems the test is failing ultimately due to pecularities with the system printf implementation. For example, when I compile+run the following #include int main() { printf("%La\n", 1.0L); printf("%L.1000f\n", 1.0L); printf("%Lf\n", 0x1.13492ffd6ec7341068e0176a737dp+3384L); } the output I get is 0x1.0000000000000000000000000000p+0 1.0000000000000000000000000000000000000000000000000000000000000000000000000= 000000000000000000000000000000000000000000000000000000000000000000000000000= 000000000000000000000000000000000000000000000000000000000000000000000000000= 000000000000000000000000000000000000000000000000000000000000000000000000000= 000000000000000000000000000000000000000000000000000000000000000000000000000= 000000000000000000000000000000000000000000000000000000000000000000000000000= 000000000000000000000000000000000000000000000000000000000000000000000000000= 000000000000000000000000000000000000000000000000000000000000000000000000000= 000000000000000000000000000000000000000000000000000000000000000000000000000= 000000000000000000000000000000000000000000000000000000000000000000000000000= 000000000000000000000000000000000000000000000000000000000000000000000000000= 000000000000000000000000000000000000000000000000000000000000000000000000000= 000000000000000000000000000000000000000000000000000000000000000000000000000= 000000000000000000000000000e+00=20 5.212539e+1018 So: 1. The hex-form conversion specifier doesn't trim trailing zeroes. 2. The fixed-form conversion specifier sometimes outputs the scientific-notation suffix "e+00". 3. The fixed-form conversion specifier sometimes outputs the scientific for= m. Each of the to_chars/printf mismatches I've looked at seem to be caused by = one of these three issues. Should we just XFAIL the test on Solaris?=