From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9B8703858D37; Thu, 20 Apr 2023 16:38:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9B8703858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682008688; bh=Pm+jYO3VgH7ps7ywUW/J5eEbzjp+acte4EpjxHanpGo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Ws5ZY/4lW+Gwc2TKHg1c+yge5XAF/0J+3a7oPcem4ZY421VFMsuM1skHu7cWoE5i+ rIVQbOmUaZJ+2QtW/EfsoWSqVDqcHiuhqaxI+RINMGH9xip85wgIeopTu2UUY3eof1 Mw+bbI2P6zdhPZ+Q5qHfjaN3S0Jge1SoNRlLyqT8= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/103387] powerpc64le: segmentation fault on std::cout with ieee128 long double variable Date: Thu, 20 Apr 2023 16:38:08 +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: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: major X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: redi at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.3 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103387 --- Comment #13 from Jonathan Wakely --- (In reply to Jonathan Wakely from comment #9) > The _M_num_put cache exists to avoid doing the RTTI check implied by > use_facet every time we use the stream. But that RTTI check has been remo= ved > for GCC 13 anyway. Since the cached facet is the cause of this bug, we can > just ignore it for powercp64le when we support two forms of long double. I've backported this to gcc-12, but we don't have the optimization to make std::use_facet faster on gcc-12 (and it requires new exported symbols, so c= an't be backported). That means there's a performance hit for those iostream ops= on gcc-12 now. But they don't segfault! Maybe I should look into a powerpc64le-specific change to avoid that performance hit on the branch. Or maybe only avoid the cached facet when outputting an __ieee128, as that's when the cached facet is not usable.=