]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Use gen_lowpart_if_possible instead of gen_lowpart to avoid ICE.
authorliuhongt <hongtao.liu@intel.com>
Mon, 13 Sep 2021 10:54:05 +0000 (18:54 +0800)
committerliuhongt <hongtao.liu@intel.com>
Mon, 13 Sep 2021 11:52:23 +0000 (19:52 +0800)
gcc/ChangeLog:

PR bootstrap/102302
* expmed.c (extract_bit_field_using_extv): Use
gen_lowpart_if_possible instead of gen_lowpart to avoid ICE.

gcc/expmed.c

index 3143f38e0570eabe56cf82c49fb84752d8e170f0..59734d4841cbd2056a7d5bda9134af79c8024c87 100644 (file)
@@ -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;
        }