Pushed to r14-5864.

在 2023/11/23 上午11:05, Guo Jie 写道:
gcc/ChangeLog:

        * config/loongarch/loongarch.cc (loongarch_split_plus_constant):
        avoid left shift of negative value -0x8000.

---
  gcc/config/loongarch/loongarch.cc | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/loongarch/loongarch.cc 
b/gcc/config/loongarch/loongarch.cc
index 33357c670e1..81cd9fa1e7c 100644
--- a/gcc/config/loongarch/loongarch.cc
+++ b/gcc/config/loongarch/loongarch.cc
@@ -4249,7 +4249,7 @@ loongarch_split_plus_constant (rtx *op, machine_mode mode)
    else if (loongarch_addu16i_imm12_operand_p (v, mode))
      a = (v & ~HWIT_UC_0xFFF) + ((v & 0x800) << 1);
    else if (mode == DImode && DUAL_ADDU16I_OPERAND (v))
-    a = (v > 0 ? 0x7fff : -0x8000) << 16;
+    a = (v > 0 ? 0x7fff0000 : ~0x7fffffff);
    else
      gcc_unreachable ();

Reply via email to