From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BC8B23858C53; Wed, 7 Feb 2024 10:14:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BC8B23858C53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707300884; bh=78BWXQpcMt2YXCNsvPACeVa4fQYNlxIZnYnASHlGn1A=; h=From:To:Subject:Date:In-Reply-To:References:From; b=GH8LnwixkXMMMK8EPT+a8I1KR7lWS1q7ChD9Y/NU/AeQPvYig7Wl2D9VYqggAzhWx INUM9hI/Ebh1kgcyDhgqneWQ57xwYrTH00UlZaUDvmvHFz49ln0wVblof2IbtCG2H3 Cc26SE8DgEFK3YBlzaFVAXSc1YldIctF7tXC3YR4= From: "lrflew.coll at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/87744] Some valid instantiations of linear_congruential_engine produce compiler errors when __int128 isn't available Date: Wed, 07 Feb 2024 10:14:42 +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: 7.3.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: lrflew.coll at gmail dot com X-Bugzilla-Status: NEW 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: 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=3D87744 --- Comment #12 from Lewis Fox --- (In reply to Jonathan Wakely from comment #2) My original comment about libc++ was in reference to the LLVM bugzilla repo= rt #27839: https://bugs.llvm.org/show_bug.cgi?id=3D27839 It looks like the issue you discovered is LLVM bugzilla report #34206: https://bugs.llvm.org/show_bug.cgi?id=3D34206 It seems like since I made that comment here, libc++ has updated to fix the misuse of Schrage's algorithm (though, looking at the current source code, = it still looks wrong to me), so it does mean my initial comment is a little ou= t of date. Either way, though, this issue wasn't in comparison to libc++, but rather t= hat libstdc++ seems to contradict the C++ standard. For reference, MSVC doesn't have a native 128-bit integer type, but still handles these correctly by us= ing 64-bit integer arithmetic (though MSVC could still optimize their implementation for x86_64 using intrinsics if they wanted to). This is a bit of an edge case that I don't think most users will encounter,= so performance is probably less important here than accuracy. I'd personally prioritize minimizing branches (i.e. improving simplicity) than optimizing = the operand sizes for performance, but that's just my opinion.=