From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2078) id 7D18B3858C60; Mon, 13 Sep 2021 11:52:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7D18B3858C60 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: hongtao Liu To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-3484] Use gen_lowpart_if_possible instead of gen_lowpart to avoid ICE. X-Act-Checkin: gcc X-Git-Author: liuhongt X-Git-Refname: refs/heads/master X-Git-Oldrev: 924326b3e0d75dbb246a4fbabfdd8be417788db8 X-Git-Newrev: c8e4cb8adf68730357888adf186ab2e686a220ad Message-Id: <20210913115246.7D18B3858C60@sourceware.org> Date: Mon, 13 Sep 2021 11:52:46 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 11:52:46 -0000 https://gcc.gnu.org/g:c8e4cb8adf68730357888adf186ab2e686a220ad commit r12-3484-gc8e4cb8adf68730357888adf186ab2e686a220ad Author: liuhongt Date: Mon Sep 13 18:54:05 2021 +0800 Use gen_lowpart_if_possible instead of gen_lowpart to avoid ICE. gcc/ChangeLog: PR bootstrap/102302 * expmed.c (extract_bit_field_using_extv): Use gen_lowpart_if_possible instead of gen_lowpart to avoid ICE. Diff: --- gcc/expmed.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/expmed.c b/gcc/expmed.c index 3143f38e057..59734d4841c 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -1571,14 +1571,16 @@ extract_bit_field_using_extv (const extraction_insn *extv, rtx op0, if (GET_MODE (target) != ext_mode) { + rtx temp; /* Don't use LHS paradoxical subreg if explicit truncation is needed between the mode of the extraction (word_mode) and the target mode. Instead, create a temporary and use convert_move to set the target. */ if (REG_P (target) - && TRULY_NOOP_TRUNCATION_MODES_P (GET_MODE (target), ext_mode)) + && TRULY_NOOP_TRUNCATION_MODES_P (GET_MODE (target), ext_mode) + && (temp = gen_lowpart_if_possible (ext_mode, target))) { - target = gen_lowpart (ext_mode, target); + target = temp; if (partial_subreg_p (GET_MODE (spec_target), ext_mode)) spec_target_subreg = target; }