]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/7042 (cris-elf miscompiles line_hints in ghostscript - "return" delay...
authorHans-Peter Nilsson <hp@axis.com>
Mon, 17 Jun 2002 22:06:34 +0000 (22:06 +0000)
committerHans-Peter Nilsson <hp@gcc.gnu.org>
Mon, 17 Jun 2002 22:06:34 +0000 (22:06 +0000)
PR target/7042
* config/cris/cris.c (cris_simple_epilogue): Kludge around reorg.c
bug by saing that the epilogue isn't simple if there's a
non-empty current_function_epilogue_delay_list.
* config/cris/cris.md ("return"): Add sanity check asserting that
current_function_epilogue_delay_list is empty.

From-SVN: r54721

gcc/ChangeLog
gcc/config/cris/cris.c
gcc/config/cris/cris.md

index b370ed1c62fb654f657a130a78daee1872a9b88f..3c59ce48977794550d1bfe669af5f9475dda39e4 100644 (file)
@@ -1,3 +1,12 @@
+2002-06-17  Hans-Peter Nilsson  <hp@axis.com>
+
+       PR target/7042
+       * config/cris/cris.c (cris_simple_epilogue): Kludge around reorg.c
+       bug by saing that the epilogue isn't simple if there's a
+       non-empty current_function_epilogue_delay_list.
+       * config/cris/cris.md ("return"): Add sanity check asserting that
+       current_function_epilogue_delay_list is empty.
+
 2002-06-17  Richard Henderson  <rth@redhat.com>
 
        * config/i386/i386.h (BIGGEST_FIELD_ALIGNMENT): Define instead
index d1200ab7fc57d7f03d404145491d216ca81d6454..b4d433bece923ae3dbe02e72e0f1d0ca4fa81eb2 100644 (file)
@@ -2042,6 +2042,14 @@ cris_simple_epilogue ()
       || current_function_outgoing_args_size
       || current_function_calls_eh_return
 
+      /* Kludge for 3.1: when reorg changes branches to the return label
+        into return insns, it does not handle the case where there's a
+        delay list for the epilogue: it just drops the insns in
+        current_function_epilogue_delay_list on the floor, resulting in
+        invalid code.  We kludge around it in that case by saying that
+        we don't have a simple enough epilogue to use return insns.  */
+      || current_function_epilogue_delay_list != NULL
+
       /* If we're not supposed to emit prologue and epilogue, we must
         not emit return-type instructions.  */
       || !TARGET_PROLOGUE_EPILOGUE)
index c437764fa352ab245ff9cf5dad4981c52695ddc1..0bed750c6ab12ed78a2cf77286d3780d5c9b6fb0 100644 (file)
   /* Just needs to hold a 'movem [sp+],rN'.  */
   char rd[sizeof (\"movem [$sp+],$r99\")];
 
+  /* Try to avoid reorg.c surprises; avoid emitting invalid code, prefer
+     crashing.  This test would have avoided invalid code for target/7042.  */
+  if (current_function_epilogue_delay_list != NULL)
+    abort ();
+
   *rd = 0;
 
   /* Start from the last call-saved register.  We know that we have a