]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
lm32: Compute pretend_size in setup_incoming_varargs even if no_rtl
authorKeith Packard <keithp@keithp.com>
Thu, 16 Jan 2025 05:08:59 +0000 (22:08 -0700)
committerJeff Law <jlaw@ventanamicro.com>
Thu, 16 Jan 2025 05:08:59 +0000 (22:08 -0700)
gcc/
* config/lm32/lm32.cc (setup_incoming_varargs): Adjust the
conditionals so that pretend_size is always computed, even
if no_rtl is set.

gcc/config/lm32/lm32.cc

index dfec28608a0a2f261362e6d47da5cb1ad0807964..b677953bb4ccec7a16886112a4bd96a8a5a05668 100644 (file)
@@ -705,16 +705,18 @@ lm32_setup_incoming_varargs (cumulative_args_t cum_v,
        ((size + UNITS_PER_WORD - 1) / UNITS_PER_WORD);
     }
 
-  if ((first_anon_arg < (LM32_FIRST_ARG_REG + LM32_NUM_ARG_REGS)) && !no_rtl)
+  if (FUNCTION_ARG_REGNO_P (first_anon_arg))
     {
-      int first_reg_offset = first_anon_arg;
       int size = LM32_FIRST_ARG_REG + LM32_NUM_ARG_REGS - first_anon_arg;
-      rtx regblock;
 
-      regblock = gen_rtx_MEM (BLKmode,
-                             plus_constant (Pmode, arg_pointer_rtx,
-                                            FIRST_PARM_OFFSET (0)));
-      move_block_from_reg (first_reg_offset, regblock, size);
+      if (!no_rtl)
+       {
+         rtx regblock
+           = gen_rtx_MEM (BLKmode,
+                          plus_constant (Pmode, arg_pointer_rtx,
+                                         FIRST_PARM_OFFSET (0)));
+         move_block_from_reg (first_anon_arg, regblock, size);
+       }
 
       *pretend_size = size * UNITS_PER_WORD;
     }