From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3F9483857C48; Tue, 28 Nov 2023 14:34:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3F9483857C48 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701182074; bh=752M4iMTQc/4/Oprnqecs219S1Qoq8MvkzSYkjgWe+Y=; h=From:To:Subject:Date:In-Reply-To:References:From; b=XDtIo2vx1W/+vW8FN+OZjXFbyD3iLxia3Mc6AlWOgn1CKaUJxS59X8t7XpL6z4Pbj OHrbeQ7K4xR4rqpG+1X3NkpBuXmUKdIeMiOng45sq3hek8gX00bRiomh1WlXF7e88k VG/r3oYdZAGauuN64OyclRqBYgjxPxBFNjGktSt4= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/112733] [14 Regression] ICE: Segmentation fault in wide-int.cc during GIMPLE pass: sccp Date: Tue, 28 Nov 2023 14:34:33 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub 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: 14.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=3D112733 --- Comment #6 from Jakub Jelinek --- One thing is obviously we shouldn't crash on it and will debug that. But, what multiple_of_p does (or its callers) is weird: 14552 /* Check for special cases to see if top is defined as multiple 14553 of bottom: 14554=20=20=20 14555 top =3D (X & ~(bottom - 1) ; bottom is power of 2 14556=20=20=20 14557 or 14558=20=20=20 14559 Y =3D X % bottom 14560 top =3D X - Y. */ 14561 if (code =3D=3D BIT_AND_EXPR 14562 && (op2 =3D gimple_assign_rhs2 (stmt)) !=3D NULL_TREE 14563 && TREE_CODE (op2) =3D=3D INTEGER_CST 14564 && integer_pow2p (bottom) 14565 && wi::multiple_of_p (wi::to_widest (op2), 14566 wi::to_widest (bottom), UNSIGNE= D)) 14567 return true; It uses UNSIGNED, but both op2 and bottom are signed: (gdb) p debug_tree (op2) constant 1> $17 =3D void (gdb) p debug_tree (bottom) constant -128> so it is in the end multiple_of_p 1, 0xffffff................fffffffffffffffffffffffff80 where the latter has 13= 1072 bits precision. That definitely doesn't have anything to do with what the source does (and didn't even when the precision was just 576 bits before).=