config/m32r/m32r.c (m32r_output_function_epilogue): Care for a large stack #
authorKazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
Fri, 8 Jul 2005 10:53:32 +0000 (10:53 +0000)
committerNick Clifton <nickc@gcc.gnu.org>
Fri, 8 Jul 2005 10:53:32 +0000 (10:53 +0000)
frame at epilogue.

From-SVN: r101759

gcc/ChangeLog
gcc/config/m32r/m32r.c

index d8ac67a19305ac96b56092ca5dacc81011e99341..2f84490a06379113c3156814b2f8d7821d5e9066 100644 (file)
@@ -4,6 +4,9 @@
        (ENDFILE_SPEC): Likewise.
        * config/m32r/m32r.h (ASM_SPEC): Likewise.
 
+       * config/m32r/m32r.c (m32r_output_function_epilogue): Care for
+       a large stack frame at epilogue.
+
 2005-07-08  David Billinghurst  <David.Billinghurst@riotinto.com>
 
        * final.c: Include sdbout.h when required.
index d772db08993107caa0ffe357f4b0576d300e112d..d6197d3da4abe80a3684fd7dac3ea8c57abbfaf7 100644 (file)
@@ -1532,11 +1532,19 @@ m32r_output_function_epilogue (FILE * file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
          else if (reg_offset < 32768)
            fprintf (file, "\tadd3 %s,%s,%s%d\n",
                     sp_str, sp_str, IMMEDIATE_PREFIX, reg_offset);
-         else
+         else if (reg_offset < (1 << 24))
            fprintf (file, "\tld24 %s,%s%d\n\tadd %s,%s\n",
                     reg_names[PROLOGUE_TMP_REGNUM],
                     IMMEDIATE_PREFIX, reg_offset,
                     sp_str, reg_names[PROLOGUE_TMP_REGNUM]);
+         else
+           fprintf (file, "\tseth %s,%s%d\n\tor3 %s,%s,%s%d\n\tadd %s,%s\n",
+                    reg_names[PROLOGUE_TMP_REGNUM],
+                    IMMEDIATE_PREFIX, reg_offset >> 16,
+                    reg_names[PROLOGUE_TMP_REGNUM],
+                    reg_names[PROLOGUE_TMP_REGNUM],
+                    IMMEDIATE_PREFIX, reg_offset & 0xffff,
+                    sp_str, reg_names[PROLOGUE_TMP_REGNUM]);
        }
       else if (frame_pointer_needed)
        {
@@ -1547,11 +1555,19 @@ m32r_output_function_epilogue (FILE * file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
          else if (reg_offset < 32768)
            fprintf (file, "\tadd3 %s,%s,%s%d\n",
                     sp_str, fp_str, IMMEDIATE_PREFIX, reg_offset);
-         else
+         else if (reg_offset < (1 << 24))
            fprintf (file, "\tld24 %s,%s%d\n\tadd %s,%s\n",
                     reg_names[PROLOGUE_TMP_REGNUM],
                     IMMEDIATE_PREFIX, reg_offset,
                     sp_str, reg_names[PROLOGUE_TMP_REGNUM]);
+         else
+           fprintf (file, "\tseth %s,%s%d\n\tor3 %s,%s,%s%d\n\tadd %s,%s\n",
+                    reg_names[PROLOGUE_TMP_REGNUM],
+                    IMMEDIATE_PREFIX, reg_offset >> 16,
+                    reg_names[PROLOGUE_TMP_REGNUM],
+                    reg_names[PROLOGUE_TMP_REGNUM],
+                    IMMEDIATE_PREFIX, reg_offset & 0xffff,
+                    sp_str, reg_names[PROLOGUE_TMP_REGNUM]);
        }
       else
        gcc_unreachable ();