OSDN Git Service

2008-04-12 Andrew Pinski <pinskia@gmail.com>
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 13 Apr 2008 03:17:01 +0000 (03:17 +0000)
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 13 Apr 2008 03:17:01 +0000 (03:17 +0000)
        * config/rs6000/rs6000.c (compute_save_world_info): Set lr_save_p if
        we are going to "save the world".

2008-04-12  Andrew Pinski  <pinskia@gmail.com>

        * gcc.target/powerpc/darwin-save-world-1.c: New test.

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

gcc/ChangeLog
gcc/config/rs6000/rs6000.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/darwin-save-world-1.c [new file with mode: 0644]

index 69cb7f2..9aa7f7d 100644 (file)
@@ -1,3 +1,8 @@
+2008-04-12  Andrew Pinski  <pinskia@gmail.com>
+
+       * config/rs6000/rs6000.c (compute_save_world_info): Set lr_save_p if
+       we are going to "save the world".
+
 2008-04-13  Hans-Peter Nilsson  <hp@axis.com>
 
        * config/cris/cris.md ("*andhi_lowpart_non_v32", "*andhi_lowpart_v32")
 2008-04-13  Hans-Peter Nilsson  <hp@axis.com>
 
        * config/cris/cris.md ("*andhi_lowpart_non_v32", "*andhi_lowpart_v32")
index be069cc..0d86894 100644 (file)
@@ -14258,6 +14258,9 @@ compute_save_world_info (rs6000_stack_t *info_ptr)
         will attempt to save it. */
       info_ptr->vrsave_size  = 4;
 
         will attempt to save it. */
       info_ptr->vrsave_size  = 4;
 
+      /* If we are going to save the world, we need to save the link register too.  */
+      info_ptr->lr_save_p = 1;
+
       /* "Save" the VRsave register too if we're saving the world.  */
       if (info_ptr->vrsave_mask == 0)
        info_ptr->vrsave_mask = compute_vrsave_mask ();
       /* "Save" the VRsave register too if we're saving the world.  */
       if (info_ptr->vrsave_mask == 0)
        info_ptr->vrsave_mask = compute_vrsave_mask ();
index 35112f2..4c4feb1 100644 (file)
@@ -1,3 +1,7 @@
+2008-04-12  Andrew Pinski  <pinskia@gmail.com>
+
+       * gcc.target/powerpc/darwin-save-world-1.c: New test.
+
 2008-04-11  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/35869
 2008-04-11  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/35869
diff --git a/gcc/testsuite/gcc.target/powerpc/darwin-save-world-1.c b/gcc/testsuite/gcc.target/powerpc/darwin-save-world-1.c
new file mode 100644 (file)
index 0000000..452060e
--- /dev/null
@@ -0,0 +1,18 @@
+/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-require-effective-target powerpc_altivec_ok } */
+/* { dg-options "-maltivec" } */
+
+/* With altivec turned on, Darwin wants to save the world but we did not mark lr as being saved any more
+   as saving the lr is not needed for saving altivec registers.  */
+
+int main (void)
+{
+  __label__ l1;
+  void __attribute__((used)) q(void)
+  {
+    goto l1;
+  }
+
+  l1:;
+  return 0;
+}