Change condition to IMM12_OPERAND (offset) on LA32.

gcc/ChangeLog:

        * config/loongarch/loongarch.cc (loongarch_get_separate_components):
        Change max offset for LA32.
---
 gcc/config/loongarch/loongarch.cc | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/gcc/config/loongarch/loongarch.cc 
b/gcc/config/loongarch/loongarch.cc
index 64acd44ef96..e06eb21efa5 100644
--- a/gcc/config/loongarch/loongarch.cc
+++ b/gcc/config/loongarch/loongarch.cc
@@ -8557,11 +8557,9 @@ loongarch_get_separate_components (void)
        /* We can wrap general registers saved at [sp, sp + 32768) using the
           ldptr/stptr instructions.  For large offsets a pseudo register
           might be needed which cannot be created during the shrink
-          wrapping pass.
-
-          TODO: This may need a revise when we add LA32 as ldptr.w is not
-          guaranteed available by the manual.  */
-       if (offset < 32768)
+          wrapping pass.  */
+       if (IMM12_OPERAND (offset)
+           || (TARGET_64BIT && (offset < 32768)))
          bitmap_set_bit (components, regno);
 
        offset -= UNITS_PER_WORD;
-- 
2.34.1

Reply via email to