在 2026/3/4 下午6:30, Xi Ruoyao 写道:
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.
---
Bootstrapped and regtested on loongarch64-linux-gnu. Ok for trunk and
15/14?
Ok, thanks!
gcc/config/loongarch/loongarch.cc | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/gcc/config/loongarch/loongarch.cc
b/gcc/config/loongarch/loongarch.cc
index 2c13a86176d..998cfb9a26a 100644
--- a/gcc/config/loongarch/loongarch.cc
+++ b/gcc/config/loongarch/loongarch.cc
@@ -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)
{