From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AB22C3858C54; Fri, 1 Dec 2023 02:01:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AB22C3858C54 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701396103; bh=+vNwoxRuyEJPfPbZVWv0N2yrWJHTbLOLvgKcUGvoyLk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=n8WWeBftwjKelZaD9Nn/R48oJDb/mxTQP0LByiRPLNfJW+Bz/Xj8pXa5yzXWavKdi JJuTNYowqLGBWEOnAoyC17b8u2MDxt9BvQApYzL/uV7nAeYdBZ9Yrg+PIldSueXd2I Qmu1zzqkwDyfoq/uoTtlDTVwJTQev5AdxlTwzbYI= From: "juzhe.zhong at rivai dot ai" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/112773] [14 Regression] RISC-V ICE: in force_align_down_and_div, at poly-int.h:1828 on rv32gcv_zvl256b Date: Fri, 01 Dec 2023 02:01:42 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: juzhe.zhong at rivai dot ai 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: 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=3D112773 --- Comment #4 from JuzheZhong --- After reproducing the ICE. I confirm the root cause is because we enable vec_extract for mask: ;; ------------------------------------------------------------------------- ;; This extracts a bit (via QImode) from a bitmask vector. ;; ------------------------------------------------------------------------- (define_expand "vec_extractqi" [(set (match_operand:QI 0 "register_operand") (vec_select:QI (match_operand:VB 1 "register_operand") (parallel [(match_operand 2 "nonmemory_operand")])))] The ICE happens optimized IR is as follows: _68 =3D BIT_FIELD_REF ; can_align_p return false for POLY_INT_CST [3, 4] since the alignment require multipe of 8: force_align_down_and_div (X, BITS_PER_UNIT) -> BITS_PER_UNIT =3D 8. It's ovbious POLY_INT_CST [3, 4] is definitely not aligned with 8. I have no idea how to fix it. CCing Robin who enable mask bit extraction should know much better than me. And CCing Richard B and Richard S may give us some useful suggestions. Thanks.=