gcc/
authorBernd Schmidt <bernd.schmidt@analog.com>
Mon, 14 Sep 2009 12:05:42 +0000 (12:05 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Mon, 14 Sep 2009 12:05:42 +0000 (12:05 +0000)
From Jie Zhang <jie.zhang@analog.com>:
* config/bfin/bfin.c (bfin_expand_prologue): Ask do_link to
save FP and RETS with saveall attribute.
(bfin_expand_epilogue): Ask do_unlink to restore FP and RETS
with saveall attribute.

gcc/testsuite/
From Jie Zhang <jie.zhang@analog.com>:
* gcc.target/bfin/saveall.c: New test.

From-SVN: r151686

gcc/ChangeLog
gcc/config/bfin/bfin.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/bfin/saveall.c [new file with mode: 0644]

index f7dc8d9..5e590ee 100644 (file)
@@ -3,6 +3,12 @@
        * config/bfin/bfin.c (bfin_longcall_p): Don't use short calls for weak
        symbols.
 
+       From Jie Zhang <jie.zhang@analog.com>:
+       * config/bfin/bfin.c (bfin_expand_prologue): Ask do_link to
+       save FP and RETS with saveall attribute.
+       (bfin_expand_epilogue): Ask do_unlink to restore FP and RETS
+       with saveall attribute.
+
 2009-09-14  Richard Guenther  <rguenther@suse.de>
 
        PR middle-end/41350
index 0a7b149..744ad3d 100644 (file)
@@ -1396,7 +1396,7 @@ bfin_expand_prologue (void)
     }
   expand_prologue_reg_save (spreg, all, false);
 
-  do_link (spreg, frame_size, false);
+  do_link (spreg, frame_size, all);
 
   if (TARGET_ID_SHARED_LIBRARY
       && !TARGET_SEP_DATA
@@ -1425,7 +1425,7 @@ bfin_expand_epilogue (int need_return, int eh_return, bool sibcall_p)
       return;
     }
 
-  do_unlink (spreg, get_frame_size (), false, e);
+  do_unlink (spreg, get_frame_size (), all, e);
 
   expand_epilogue_reg_restore (spreg, all, false);
 
index 9928656..d2f7d54 100644 (file)
@@ -1,3 +1,8 @@
+2009-09-14  Bernd Schmidt  <bernd.schmidt@analog.com>
+
+       From Jie Zhang <jie.zhang@analog.com>:
+       * gcc.target/bfin/saveall.c: New test.
+
 2009-09-14  Andrew Stubbs  <ams@codesourcery.com>
 
        * gcc.target/sh/20080410-1.c: Remove obsolete -fira option.
diff --git a/gcc/testsuite/gcc.target/bfin/saveall.c b/gcc/testsuite/gcc.target/bfin/saveall.c
new file mode 100644 (file)
index 0000000..19f9dec
--- /dev/null
@@ -0,0 +1,14 @@
+/* { dg-do run { target bfin*-*-* } } */
+/* { dg-options "-fomit-frame-pointer" } */
+
+void foo (void) __attribute__ ((saveall));
+void foo ()
+{
+  asm ("R0 = 0; RETS = R0;");
+}
+
+int main ()
+{
+  foo ();
+  return 0;
+}