]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
arc: Update stack size computation when accumulator registers are available.
authorClaudiu Zissulescu <claziss@synopsys.com>
Thu, 25 Nov 2021 13:38:03 +0000 (15:38 +0200)
committerClaudiu Zissulescu <claziss@synopsys.com>
Fri, 14 Jan 2022 10:24:51 +0000 (12:24 +0200)
When accumulator registers are available in a processor, they need to
be save onto stack durring interrupts.  We were already doing so, but
the stack size was wrongly computed in the case other than ARC600.

gcc/

* config/arc/arc.c (arc_compute_frame_size): Remove condition when
computin checking accumulator regs.
(arc_expand_prologue): Update comments.
(arc_expand_epilogue): Likewise.

Signed-off-by: Claudiu Zissulescu <claziss@synopsys.com>
gcc/config/arc/arc.c

index 6de364e9ce02e1aee40d3988d412361c44f099c4..3096a9bef4487a0ed313302f4928c915aacee6ba 100644 (file)
@@ -2897,9 +2897,8 @@ arc_compute_frame_size (void)
                              cfun, TARGET_DPFP))
     reg_size += UNITS_PER_WORD * 2;
 
-  /* Check for special MLO/MHI case used by ARC600' MUL64
-     extension.  */
-  if (arc_must_save_register (R58_REG, cfun, TARGET_MUL64_SET))
+  /* Check if R58 is used.  */
+  if (arc_must_save_register (R58_REG, cfun, true))
     reg_size += UNITS_PER_WORD * 2;
 
   /* 4) Calculate extra size made up of the blink + fp size.  */
@@ -3878,7 +3877,7 @@ arc_expand_prologue (void)
        }
     }
 
-  /* Save ARC600' MUL64 registers.  */
+  /* Save accumulator registers.  */
   if (arc_must_save_register (R58_REG, cfun, true))
     frame_size_to_allocate -= arc_save_callee_saves (3ULL << 58,
                                                     false, false, 0, false);
@@ -3971,7 +3970,7 @@ arc_expand_epilogue (int sibcall_p)
       first_offset = 0;
     }
 
-  /* Restore ARC600' MUL64 registers.  */
+  /* Restore accumulator registers.  */
   if (arc_must_save_register (R58_REG, cfun, true))
     {
       rtx insn;