If the size of struct <= 2 * GRLEN, pass by registers if available.

gcc/ChangeLog:

        * config/loongarch/loongarch-opts.cc (loongarch_target_option_override):
        Delete LP64 condition.
        * config/loongarch/loongarch.h (DEFAULT_PCC_STRUCT_RETURN): New macro.
---
 gcc/config/loongarch/loongarch-opts.cc | 4 ----
 gcc/config/loongarch/loongarch.h       | 2 ++
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/gcc/config/loongarch/loongarch-opts.cc 
b/gcc/config/loongarch/loongarch-opts.cc
index aeb118ab342..fba06827c7b 100644
--- a/gcc/config/loongarch/loongarch-opts.cc
+++ b/gcc/config/loongarch/loongarch-opts.cc
@@ -1039,10 +1039,6 @@ loongarch_target_option_override (struct 
loongarch_target *target,
   if (!opts_set->x_la_addr_reg_reg_cost)
     opts->x_la_addr_reg_reg_cost = loongarch_cost->addr_reg_reg_cost;
 
-  /* other stuff */
-  if (ABI_LP64_P (target->abi.base))
-    opts->x_flag_pcc_struct_return = 0;
-
   switch (target->cmodel)
     {
       case CMODEL_EXTREME:
diff --git a/gcc/config/loongarch/loongarch.h b/gcc/config/loongarch/loongarch.h
index 12882395141..b2c66fa6a3a 100644
--- a/gcc/config/loongarch/loongarch.h
+++ b/gcc/config/loongarch/loongarch.h
@@ -656,6 +656,8 @@ enum reg_class
 
 #define REG_PARM_STACK_SPACE(FNDECL) 0
 
+#define DEFAULT_PCC_STRUCT_RETURN 0
+
 /* Define this if it is the responsibility of the caller to
    allocate the area reserved for arguments passed in registers.
    If `ACCUMULATE_OUTGOING_ARGS' is also defined, the only effect
-- 
2.34.1

Reply via email to