From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7973D3836E80; Tue, 28 Nov 2023 16:01:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7973D3836E80 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701187268; bh=Cm+tjWbvjFSKSVdLTymKTUwlamLjSMQxnzvzvFhTnOk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=UnTxjT1T7vsCtEbWL8N5vnW2H8bKdTB6bwnx/EFmc0LI4n3w84U8x1WoUHDyeKd5L 5KK7D93ZyxEwCN4WcEbkk1WpImCOlXJZNk4svQFrq9nf93LCgqJh73/KsAJ3lRWD5I PfGKpnrWQvvHFZ8bc8qFBHcX4v9P0AFWXaTKfems= 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 16:01:08 +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 #9 from Jakub Jelinek --- Actually, maybe better variant of the first fix in the above comment would = be: --- gcc/wide-int.cc.jj 2023-11-28 16:56:50.000000000 +0100 +++ gcc/wide-int.cc 2023-11-28 16:58:02.268776755 +0100 @@ -1985,6 +1985,8 @@ wi::divmod_internal (HOST_WIDE_INT *quot if (remainder) { + if (n > dividend_blocks_needed) + n =3D dividend_blocks_needed; *remainder_len =3D wi_pack (remainder, b_remainder, n, dividend_prec= ); /* The remainder is always the same sign as the dividend. */ if (dividend_neg) where the check which is useless for multiplication and quotient is done on= ly in the problematic spot - remainder.=