Patchwork [committed] PR target/55276

login
register
mail settings
Submitter David Edelsohn
Date Nov. 19, 2012, 6:13 p.m.
Message ID <CAGWvnymOJP2M=PdqTNt_7WWKTtz==wUvSRxef2s1sYYZem-haw@mail.gmail.com>
Download mbox | patch
Permalink /patch/200055/
State New
Headers show

Comments

David Edelsohn - Nov. 19, 2012, 6:13 p.m.
Mans pointed our in the PR that the change to not save VRSAVE register
affected saving of callee saved registers.  This patch partially
reverts the earlier patch so vrsave_mask is computed, but VRSAVE is
not written and not saved unless TARGET_ALTIVEC_VRSAVE is set.

Committed.

- David

2012-11-19  Mans Rullgard  <mans@mansr.com>

        PR target/55276
        * config/rs6000/rs6000.c (rs6000_stack_info): Always set vrsave_mask
        for TARGET_ALTIVEC_ABI.  Zero vrsave_save_offset if
        !TARGET_ALTIVEC_VRSAVE.
        (rs6000_emit_prologue): For SAVE_INLINE_VLRs, check vrsave_size
        not vrsave_mask.

Patch

Index: rs6000.c
===================================================================
--- rs6000.c	(revision 193626)
+++ rs6000.c	(working copy)
@@ -17838,8 +17838,7 @@ 
   else
     info_ptr->spe_gp_size = 0;

-  /* Set VRSAVE register if it is saved and restored.  */
-  if (TARGET_ALTIVEC_ABI && TARGET_ALTIVEC_VRSAVE)
+  if (TARGET_ALTIVEC_ABI)
     info_ptr->vrsave_mask = compute_vrsave_mask ();
   else
     info_ptr->vrsave_mask = 0;
@@ -18027,7 +18026,8 @@ 
   if (! TARGET_ALTIVEC_ABI || info_ptr->altivec_size == 0)
     info_ptr->altivec_save_offset = 0;

-  if (! TARGET_ALTIVEC_ABI || info_ptr->vrsave_mask == 0)
+  /* Zero VRSAVE offset if not saved and restored.  */
+  if (! TARGET_ALTIVEC_VRSAVE || info_ptr->vrsave_mask == 0)
     info_ptr->vrsave_save_offset = 0;

   if (! TARGET_SPE_ABI
@@ -20058,7 +20058,7 @@ 
 	  || (info->altivec_size != 0
 	      && (info->altivec_save_offset + info->altivec_size - 16
 		  + info->total_size - frame_off) > 32767)
-	  || (info->vrsave_mask != 0
+	  || (info->vrsave_size != 0
 	      && (info->vrsave_save_offset
 		  + info->total_size - frame_off) > 32767))
 	{