From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CE5FD3858D35; Sun, 4 Jun 2023 03:58:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CE5FD3858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685851102; bh=Abe1hlU8HM4F2zhhSfvlLOdpVvOSbGjqmyhhTFYcTZs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=EmWpbWYuxQrk4qXta3ewiuL39Aff1oMnBHg+BZQEGMxm7mcDaHC1OUKZE/Om1KnxZ CJ7Z6v6hbHgvXYojYtG61yseY0D68/dNR+7KOHu/1oGcdMzV6LJD7S23veBFE4Sl4Y FrlFju7ERB4fw1525U9hb8qMng7o55rWa1yDLl7U= From: "juzhe.zhong at rivai dot ai" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/110109] RISC-V: ICE when build the Intrinsic code Date: Sun, 04 Jun 2023 03:58:22 +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: --- 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=3D110109 --- Comment #2 from JuzheZhong --- (define_insn_and_split "*vlmul_extx2" [(set (match_operand: 0 "register_operand" "=3Dvr, ?&vr") (subreg: (match_operand:VLMULEXT2 1 "register_operand" " 0, vr") 0))] "TARGET_VECTOR" "#" "&& reload_completed" [(const_int 0)] { emit_insn (gen_rtx_SET (gen_lowpart (mode, operands[0]), operands[1= ])); DONE; }) (define_insn_and_split "*vlmul_extx4" [(set (match_operand: 0 "register_operand" "=3Dvr, ?&vr") (subreg: (match_operand:VLMULEXT4 1 "register_operand" " 0, vr") 0))] "TARGET_VECTOR" "#" "&& reload_completed" [(const_int 0)] { emit_insn (gen_rtx_SET (gen_lowpart (mode, operands[0]), operands[1= ])); DONE; }) (define_insn_and_split "*vlmul_extx8" [(set (match_operand: 0 "register_operand" "=3Dvr, ?&vr") (subreg: (match_operand:VLMULEXT8 1 "register_operand" " 0, vr") 0))] "TARGET_VECTOR" "#" "&& reload_completed" [(const_int 0)] { emit_insn (gen_rtx_SET (gen_lowpart (mode, operands[0]), operands[1= ])); DONE; }) (define_insn_and_split "*vlmul_extx16" [(set (match_operand: 0 "register_operand" "=3Dvr, ?&vr") (subreg: (match_operand:VLMULEXT16 1 "register_operand" " 0, vr") 0))] "TARGET_VECTOR" "#" "&& reload_completed" [(const_int 0)] { emit_insn (gen_rtx_SET (gen_lowpart (mode, operands[0]), operands[1= ])); DONE; }) (define_insn_and_split "*vlmul_extx32" [(set (match_operand: 0 "register_operand" "=3Dvr, ?&vr") (subreg: (match_operand:VLMULEXT32 1 "register_operand" " 0, vr") 0))] "TARGET_VECTOR" "#" "&& reload_completed" [(const_int 0)] { emit_insn (gen_rtx_SET (gen_lowpart (mode, operands[0]), operands[1= ])); DONE; }) (define_insn_and_split "*vlmul_extx64" [(set (match_operand: 0 "register_operand" "=3Dvr, ?&vr") (subreg: (match_operand:VLMULEXT64 1 "register_operand" " 0, vr") 0))] "TARGET_VECTOR" "#" "&& reload_completed" [(const_int 0)] { emit_insn (gen_rtx_SET (gen_lowpart (mode, operands[0]), operands[1= ])); DONE; }) I realize when I removed these patterns, issue is fixed. I am not sure whether it is correct fix since these patterns are existing in GCC13 which doesn't have such issue. The reason I add this patterns since GCC can not well handle subreg, If I simpily use emit_insn (gen_rtx_SET (gen_lowpart (mode, operands[0]), operands[1]));=20 in "expand" stage, it can not assign regno(operands[0]) =3D=3D regno (opera= nds[1]) in RA, so I use constraint to force it. These patterns are performance optimization patterns. Should I remove those patterns and just use=20 emit_insn (gen_rtx_SET (gen_lowpart (mode, operands[0]), operands[1])= ); in "expand" stage to fix this issue even though it demage the performance.=