]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Partially revert "LoongArch: Fix bug123807."
authorXi Ruoyao <xry111@xry111.site>
Thu, 26 Feb 2026 14:54:18 +0000 (22:54 +0800)
committerXi Ruoyao <xry111@xry111.site>
Thu, 5 Mar 2026 10:04:36 +0000 (18:04 +0800)
This reverts the loongarch.cc change of the commit
4df77a254263e96af1ab4d1288a35cff10c515a4.

PR 123807 turns out to be a special case of the middle-end PR 124250.
The previous ad-hoc fix is unneeded now since the underlying middle-end
issue is fixed, so revert it but keep the test case.

gcc/

PR target/123807
PR middle-end/124250
* config/loongarch/loongarch.cc
(loongarch_expand_vector_init_same): Revert r16-7163 change.

gcc/config/loongarch/loongarch.cc

index 2c13a86176d04e9b2b90505c024d756faddcecbd..998cfb9a26a23d4d2aa260d3195464be1081fe49 100644 (file)
@@ -10378,16 +10378,7 @@ loongarch_expand_vector_init_same (rtx target, rtx vals, unsigned nvar)
        }
     }
 
-  if (GET_CODE (same) == MEM && GET_MODE (same) != imode)
-    {
-      rtx reg_tmp = gen_reg_rtx (GET_MODE (same));
-      loongarch_emit_move (reg_tmp, same);
-      temp = lowpart_subreg (imode, reg_tmp, GET_MODE (reg_tmp));
-    }
-  else
-    temp = same;
-
-  temp = force_reg (imode, temp);
+  temp = force_reg (imode, same);
 
   switch (vmode)
     {