OSDN Git Service

PR target/17377
authorhp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 9 Sep 2004 20:36:31 +0000 (20:36 +0000)
committerhp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 9 Sep 2004 20:36:31 +0000 (20:36 +0000)
* config/cris/cris-protos.h (cris_return_address_on_stack): Declare.
* config/cris/cris.c (cris_return_address_on_stack): New function.
* config/cris/cris.md ("return"): For location of return address,
also check cris_return_address_on_stack.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87251 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/cris/cris-protos.h
gcc/config/cris/cris.c
gcc/config/cris/cris.md

index 7df8981..8d1f90f 100644 (file)
@@ -1,3 +1,11 @@
+2004-09-09  Hans-Peter Nilsson  <hp@axis.com>
+
+       PR target/17377
+       * config/cris/cris-protos.h (cris_return_address_on_stack): Declare.
+       * config/cris/cris.c (cris_return_address_on_stack): New function.
+       * config/cris/cris.md ("return"): For location of return address,
+       also check cris_return_address_on_stack.
+
 2004-09-09  Diego Novillo  <dnovillo@redhat.com>
 
        * tree-outof-ssa.c (coalesce_abnormal_edges): Fix typo in
index 0e65dc2..15e91df 100644 (file)
@@ -47,6 +47,8 @@ extern int cris_cfun_uses_pic_table (void);
 extern void cris_target_asm_named_section (const char *, unsigned int);
 #endif /* RTX_CODE */
 
+extern int cris_return_address_on_stack (void);
+
 extern void cris_pragma_expand_mul (struct cpp_reader *);
 
 /* Need one that returns an int; usable in expressions.  */
index 25db5ec..468859f 100644 (file)
@@ -1700,6 +1700,15 @@ cris_return_addr_rtx (int count, rtx frameaddr ATTRIBUTE_UNUSED)
     : NULL_RTX;
 }
 
+/* Accessor used in cris.md:return because cfun->machine isn't available
+   there.  */
+
+int
+cris_return_address_on_stack ()
+{
+  return cfun->machine->needs_return_address_on_stack;
+}
+
 /* This used to be the INITIAL_FRAME_POINTER_OFFSET worker; now only
    handles FP -> SP elimination offset.  */
 
index 4001a2a..be137a5 100644 (file)
   if (i >= 0)
     sprintf (rd, \"movem [$sp+],$%s\", reg_names [i]);
 
-  if (regs_ever_live[CRIS_SRP_REGNUM])
+  if (regs_ever_live[CRIS_SRP_REGNUM]
+      || cris_return_address_on_stack ())
     {
       if (*rd)
        output_asm_insn (rd, operands);
 }"
   [(set (attr "slottable")
        (if_then_else
-        (ne (symbol_ref "regs_ever_live[CRIS_SRP_REGNUM]") (const_int 0))
+        (ne (symbol_ref
+             "(regs_ever_live[CRIS_SRP_REGNUM]
+               || cris_return_address_on_stack ())")
+            (const_int 0))
         (const_string "no")         ; If jump then not slottable.
         (if_then_else
          (ne (symbol_ref