From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5E126385842E; Tue, 28 Mar 2023 13:44:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5E126385842E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1680011081; bh=RaZtvR3+FHELeRZNA6WKX8lon/8U7Q+qI5jl1H7SXp0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ebY40WAuZFmhVi8W/uajrYl8grD+TOp5YtywYVek/ZTVx6kmvhNDohciByi/ioitd TzyBSmJ92nedc1teBmhqMJMaYUu4g76eERWT5SfPV3bwAZm6JWNnQK3nO+cuU9Fvb8 RqA+eSJ3m1Mhl0pRa5qxlarJqRN7kHeesCKd3lN4= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/109187] [13 Regression] ICE: qsort checking failed: qsort comparator non-negative on sorted output: 1736258160 at -O2 since r13-5154-g733a1b777f16cd Date: Tue, 28 Mar 2023 13:44:40 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: ice-checking, ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: amonakov at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109187 --- Comment #5 from CVS Commits --- The master branch has been updated by Alexander Monakov : https://gcc.gnu.org/g:fb046e69f0ed2d637ea715ae71ad50131f30cb2d commit r13-6907-gfb046e69f0ed2d637ea715ae71ad50131f30cb2d Author: Alexander Monakov Date: Tue Mar 28 16:00:37 2023 +0300 haifa-sched: fix autopref_rank_for_schedule comparator [PR109187] Do not attempt to use a plain subtraction for generating a three-way comparison result in autopref_rank_for_schedule qsort comparator, as offsets are not restricted and subtraction may overflow. Open-code a safe three-way comparison instead. gcc/ChangeLog: PR rtl-optimization/109187 * haifa-sched.cc (autopref_rank_for_schedule): Avoid use of overflowing subtraction in three-way comparison. gcc/testsuite/ChangeLog: PR rtl-optimization/109187 * gcc.dg/pr109187.c: New test.=