public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: hongtao Liu <liuhongt@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-3484] Use gen_lowpart_if_possible instead of gen_lowpart to avoid ICE.
Date: Mon, 13 Sep 2021 11:52:46 +0000 (GMT)	[thread overview]
Message-ID: <20210913115246.7D18B3858C60@sourceware.org> (raw)

https://gcc.gnu.org/g:c8e4cb8adf68730357888adf186ab2e686a220ad

commit r12-3484-gc8e4cb8adf68730357888adf186ab2e686a220ad
Author: liuhongt <hongtao.liu@intel.com>
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;
 	}


                 reply	other threads:[~2021-09-13 11:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210913115246.7D18B3858C60@sourceware.org \
    --to=liuhongt@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).