From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C50253858C2C; Tue, 2 Jan 2024 18:51:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C50253858C2C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1704221461; bh=FfeVwwt3CvQIsV8c1MAbM1o3RxxCO2ccbTROl04m7GE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DZdXV6XVjORpC1iPgbpIrIEuvmzVPd8HSsy7P0iMDIzq9XkRb5zD2mMnvHmGlvsIw SNT2ugo0Czxv1t5gg0d15Zv9akI2ZltQ+2hrMoeTfCvz2oBerc8HX5wYiYKu03Q7d0 om0BtQPmaBm6eKKuPXxiks9Lx2kZf596lYzuWg14= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/113204] [14 Regression] lto1: error: qsort comparator non-negative on sorted output: 64 Date: Tue, 02 Jan 2024 18:51:01 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: lto X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: ice-on-valid-code, lto X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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=3D113204 --- Comment #1 from Andrew Pinski --- The comparison function in question: ``` static int cmp_symbol_files (const void *pn1, const void *pn2, void *id_map_) { const symtab_node *n1 =3D *(const symtab_node * const *)pn1; const symtab_node *n2 =3D *(const symtab_node * const *)pn2; hash_map *id_map =3D (hash_map *)id_map_; int file_order1 =3D n1->lto_file_data ? n1->lto_file_data->order : -1; int file_order2 =3D n2->lto_file_data ? n2->lto_file_data->order : -1; /* Order files same way as they appeared in the command line to reduce seeking while copying sections. */ if (file_order1 !=3D file_order2) return file_order1 - file_order2; /* Order within static library. */ if (n1->lto_file_data && n1->lto_file_data->id !=3D n2->lto_file_data->id) return *id_map->get (n1->lto_file_data) - *id_map->get (n2->lto_file_da= ta); /* And finaly order by the definition order. */ return n1->order - n2->order; } ``` I wonder if the map changes ...=