From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7C4F33858436; Wed, 3 Jan 2024 11:09:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7C4F33858436 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1704280178; bh=q5dB63pGT/z10bAPDxlHY/Wk5AfWVcurYPXUpSPo3XE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=qdXExxWvGYnt8OC9Nveok2IGxzY6+hyzSXjv9aPDGMssgg6xeg1kc/NSVlKgAXiQl 4S+DqiJP675vVff+rJdjU01MqqLTvAYiJxeKox5nF/uOOOtJvSpKbNf0dFtEHS2x8x 52IeWV/YsI0eKZ6KPfmgpRz/A56RE0yrQu6p5OOo= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/113159] More robust std::sort for silly comparator functions Date: Wed, 03 Jan 2024 11:09:32 +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: redi 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 #8 from Jonathan Wakely --- I haven't seen a proof that libstdc++'s std::sort can't be made more robust without losing performance. Maybe cheap range checks can be done conditiona= lly when _GLIBCXX_ASSERTIONS is defined, or maybe they'll be cheap enough to do unconditionally. Some work is needed to see what's feasible, but there's no reason to just close the request as INVALID.=