From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BC5753858C50; Fri, 29 Dec 2023 00:33:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BC5753858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1703809995; bh=Id7x8lcyR9pfVYZHweRA81oFVnl8Z65VPDk/Z5ub6ig=; h=From:To:Subject:Date:In-Reply-To:References:From; b=EU0y8QTDiPQ0gAFp8W7vf6f6AtY54dmHWGSwcq/xP9OBGGAAPgwv5SZpNoEs+SVfS HjGijRMfsyMKcIKY0ZZT+KRGligU2GExhr9o6twMZObFqTY626jNYi+xKLQhMC4CnS K1YSVuQMu6WH+clO3zOs1Abf8chrCfnnXbYBi6dk= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/113159] More robust std::sort for silly comparator functions Date: Fri, 29 Dec 2023 00:33:14 +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: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia at gcc dot gnu.org 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=3D113159 --- Comment #5 from Andrew Pinski --- (In reply to Jan Engelhardt from comment #4) > >And in upcoming Glibc-2.39 there will be a major reimplementation of qso= rt >=20 > Even so, a recent commit strongly suggests that sticking to array bounds > remains important: So IIRC the reasoning is because of bugs in older (current as of a month ago even) versions of LLVM which crashes on a comparison with itself. Basically broken comparison functions are forcing workarounds really. Note GCC uses its own sort function due which is designed to detect the brokeness of comparison functions even; see PR 109187, PR 90282, PR 87281, = PR 84345, etc.=