public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Extraneous changes
@ 2007-05-18  5:58 Mike Stump
  2007-05-18  7:56 ` Eric Christopher
  0 siblings, 1 reply; 2+ messages in thread
From: Mike Stump @ 2007-05-18  5:58 UTC (permalink / raw)
  To: gcc-patches

Eric, in your recent patch, you put in the below...  :-(

This bears little relationship with the patch that you emailed out.
Please adjust your email proceedure to include the output of svn diff
of the thing that you want to check in.  I'm happy to reject it, but
can't, if I can't see what you want to put in.  If you edit a patch
post emailing it out and before you check it in, send the updated
patch out.

Also, review the output of svn diff just before checking in.

Also, please attach the patches to the radars.

Thanks.

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 127294)
+++ ChangeLog	(revision 127295)
@@ -1,3 +1,10 @@
+2007-05-16  Eric Christopher  <echristo@apple.com>
+
+	Radar 4663646
+	* config/rs6000/rs6000.c (rs6000_emit_prologue): Move altivec register
+        saving after stack push. Set sp_offset whenever we push.
+        (rs6000_emit_epilogue): Move altivec register restore before stack push.
+
 2007-05-07  Mike Stump  <mrs@apple.com>
 
 	* doc/invoke.texi (Warning Options): Document that -Wempty-body
@@ -7,7 +14,7 @@
 
 	* tree-ssa-propagate.c (cfg_blocks_add): Insert blocks with fewer
 	predecessors at head rather than tail.
-	
+
 2006-09-11  Geoffrey Keating  <geoffk@apple.com>
 
 	* coverage.c (coverage_checksum_string): Update comment.
@@ -217,7 +224,7 @@
 
 2007-04-27  Anatoly Sokolov <aesok@post.ru>
 
-	* config/avr/avr.c (avr_mcu_types): Add support for ATmega8HVA and 
+	* config/avr/avr.c (avr_mcu_types): Add support for ATmega8HVA and
 	ATmega16HVA devices. Move AT90USB82 device to 'avr5' architecture.
 	* config/avr/avr.h (LINK_SPEC, CRT_BINUTILS_SPECS): (Ditto.).
 	* config/avr/t-avr (MULTILIB_MATCHES): (Ditto.).
@@ -400,7 +407,7 @@
 
 	* config/avr/avr.c (avr_arch_types): Rearranging  array.
 	(enum avr_arch): Add.
-	(avr_mcu_types): Use avr_arch enumeration constants instead of 
+	(avr_mcu_types): Use avr_arch enumeration constants instead of
 	numbers.
 	* config/avr/avr.h (LINK_SPEC): Simplify.
 
@@ -453,13 +460,13 @@
 2007-04-07  Anatoly Sokolov <aesok@post.ru>
 
 	PR target/30289
-	* config/avr/avr.md (*clrmemqi, *clrmemhi): Mark operand 4 as 
+	* config/avr/avr.md (*clrmemqi, *clrmemhi): Mark operand 4 as
 	earlyclobber.
 
 2007-04-05  Anatoly Sokolov <aesok@post.ru>
 
 	PR target/25448
-	* config/avr/avr.c (avr_handle_fndecl_attribute): Use the 
+	* config/avr/avr.c (avr_handle_fndecl_attribute): Use the
 	DECL_ASSEMBLER_NAME, not the DECL_NAME.
 
 2007-04-04  Richard Henderson  <rth@redhat.com>
Index: config/rs6000/rs6000.c
===================================================================
--- config/rs6000/rs6000.c	(revision 127294)
+++ config/rs6000/rs6000.c	(revision 127295)
@@ -1457,10 +1457,10 @@
       flag_strict_aliasing = 1;
       flag_schedule_interblock = 1;
       flag_gcse_las = 1;
-      align_jumps_max_skip = 15; 
+      align_jumps_max_skip = 15;
       align_loops_max_skip = 15;
       align_functions = 16;
-      align_loops = 16; 
+      align_loops = 16;
       align_jumps = 16;
       set_fast_math_flags (1);
       flag_reorder_blocks = 1;
@@ -1468,7 +1468,7 @@
 	flag_reorder_blocks_and_partition = 1;
       if (!flag_pic)
 	target_flags |= MASK_MACHO_DYNAMIC_NO_PIC;
-        
+
       if (mcpu_cpu == PROCESSOR_POWER4)
       {
 	target_flags |= MASK_POWERPC;
@@ -1500,8 +1500,8 @@
     target_flags |=  ~target_flags_explicit & MASK_MULTIPLE;
 
   /* If we are optimizing big endian systems for space, use the
-     string instructions.  But do not do this for Darwin, as the 
-     kernel can't properly support some hardware that doesn't have 
+     string instructions.  But do not do this for Darwin, as the
+     kernel can't properly support some hardware that doesn't have
      these instructions.  It's not clear that the compiler is the
      right place to fix this, but that's how it is for now.  See
      *extensive* discussion in Radar 3509006.  */
@@ -1902,7 +1902,7 @@
       set_param_value ("sra-max-structure-size", 36);
       /* Another parameter has been added in mainline, which by default
 	 should be parallel to the one above. */
-      set_param_value ("sra-max-structure-count", 
+      set_param_value ("sra-max-structure-count",
 		       SRA_MAX_STRUCTURE_SIZE / UNITS_PER_WORD);
       /* APPLE LOCAL end 3893112 */
     }
@@ -4597,8 +4597,8 @@
 	  if (DEFAULT_ABI == ABI_DARWIN && MACHOPIC_INDIRECT)
 	    {
 	      /* APPLE LOCAL begin radar 4232296 */
-	      /* If a symbol node has been generated but its flags not set; such as in the course of 
-		 cost computation of generated code, do not attempt to update the static tables which 
+	      /* If a symbol node has been generated but its flags not set; such as in the course of
+		 cost computation of generated code, do not attempt to update the static tables which
 		 rely on flags of the referenced symbol to have been set. Otherwise, bogus PIC stub
 		 will be generated. */
               if (!(GET_CODE (operands[1]) == SYMBOL_REF && SYMBOL_REF_FLAGS (operands[1]) == 0))
@@ -14556,7 +14556,7 @@
     return LAST_ALTIVEC_REGNO + 1;
 
   /* On Darwin, the unwind routines are compiled without
-     TARGET_ALTIVEC, and use save_world to save/restore the 
+     TARGET_ALTIVEC, and use save_world to save/restore the
      altivec registers when necessary.  */
   if (DEFAULT_ABI == ABI_DARWIN && current_function_calls_eh_return
       && ! TARGET_ALTIVEC)
@@ -14580,7 +14580,7 @@
   unsigned int i, mask = 0;
 
   /* On Darwin, the unwind routines are compiled without
-     TARGET_ALTIVEC, and use save_world to save/restore the 
+     TARGET_ALTIVEC, and use save_world to save/restore the
      call-saved altivec registers when necessary.  */
   if (DEFAULT_ABI == ABI_DARWIN && current_function_calls_eh_return
       && ! TARGET_ALTIVEC)
@@ -14927,7 +14927,7 @@
 	  info_ptr->vrsave_save_offset
 	    = info_ptr->gp_save_offset - info_ptr->vrsave_size;
 
-	  /* Align stack so vector save area is on a quadword boundary.  
+	  /* Align stack so vector save area is on a quadword boundary.
 	     The padding goes above the vectors.  */
 	  if (info_ptr->altivec_size != 0)
 	    info_ptr->altivec_padding_size
@@ -16247,7 +16247,7 @@
 	{
 	  rtx lr = gen_rtx_REG (Pmode, LINK_REGISTER_REGNUM);
           rtx src = machopic_function_base_sym ();
-	  objc_method_using_pic = 1;	
+	  objc_method_using_pic = 1;
 	  rs6000_maybe_dead (emit_insn (gen_load_macho_picbase_label (lr,
 					src)));
 	}
@@ -16406,7 +16406,7 @@
 				   GEN_INT (info->lr_save_offset
 					    + sp_offset));
 	  rtx mem = gen_frame_mem (reg_mode, addr);
-	  
+
 	  RTVEC_ELT (p, j++) = gen_rtx_SET (VOIDmode, mem, reg0);
 	}
       /* Explain what happens to the stack pointer.  */
@@ -16421,76 +16421,8 @@
       sp_offset = info->total_size;
     }
 
-  /* Save AltiVec registers if needed.  */
-  if (!WORLD_SAVE_P (info) && TARGET_ALTIVEC_ABI && info->altivec_size != 0)
-    {
-      int i;
-
-      /* There should be a non inline version of this, for when we
-	 are saving lots of vector registers.  */
-      for (i = info->first_altivec_reg_save; i <= LAST_ALTIVEC_REGNO; ++i)
-	if (info->vrsave_mask & ALTIVEC_REG_BIT (i))
-	  {
-	    rtx areg, savereg, mem;
-	    int offset;
-
-	    offset = info->altivec_save_offset + sp_offset
-	      + 16 * (i - info->first_altivec_reg_save);
-
-	    savereg = gen_rtx_REG (V4SImode, i);
-
-	    areg = gen_rtx_REG (Pmode, 0);
-	    emit_move_insn (areg, GEN_INT (offset));
-
-	    /* AltiVec addressing mode is [reg+reg].  */
-	    mem = gen_frame_mem (V4SImode,
-				 gen_rtx_PLUS (Pmode, frame_reg_rtx, areg));
-
-	    insn = emit_move_insn (mem, savereg);
-
-	    rs6000_frame_related (insn, frame_ptr_rtx, info->total_size,
-				  areg, GEN_INT (offset));
-	  }
-    }
-
-  /* VRSAVE is a bit vector representing which AltiVec registers
-     are used.  The OS uses this to determine which vector
-     registers to save on a context switch.  We need to save
-     VRSAVE on the stack frame, add whatever AltiVec registers we
-     used in this function, and do the corresponding magic in the
-     epilogue.  */
-
-  if (TARGET_ALTIVEC && TARGET_ALTIVEC_VRSAVE
-      && info->vrsave_mask != 0)
-    {
-      rtx reg, mem, vrsave;
-      int offset;
-
-      /* Get VRSAVE onto a GPR.  Note that ABI_V4 might be using r12
-	 as frame_reg_rtx and r11 as the static chain pointer for
-	 nested functions.  */
-      reg = gen_rtx_REG (SImode, 0);
-      vrsave = gen_rtx_REG (SImode, VRSAVE_REGNO);
-      if (TARGET_MACHO)
-	emit_insn (gen_get_vrsave_internal (reg));
-      else
-	emit_insn (gen_rtx_SET (VOIDmode, reg, vrsave));
-
-      if (!WORLD_SAVE_P (info))
-	{
-          /* Save VRSAVE.  */
-          offset = info->vrsave_save_offset + sp_offset;
-          mem = gen_frame_mem (SImode,
-			       gen_rtx_PLUS (Pmode, frame_reg_rtx,
-					     GEN_INT (offset)));
-          insn = emit_move_insn (mem, reg);
-	}
-
-      /* Include the registers in the mask.  */
-      emit_insn (gen_iorsi3 (reg, reg, GEN_INT ((int) info->vrsave_mask)));
-
-      insn = emit_insn (generate_set_vrsave (reg, info, 0));
-    }
+  /* APPLE LOCAL mainline */
+  /* Moved altivec save/restore.  */
 
   /* If we use the link register, get it into r0.  */
   if (!WORLD_SAVE_P (info) && info->lr_save_p)
@@ -16816,9 +16748,14 @@
 
   /* Update stack and set back pointer unless this is V.4,
      for which it was done previously.  */
+  /* APPLE LOCAL begin mainline */
   if (!WORLD_SAVE_P (info) && info->push_p
       && !(DEFAULT_ABI == ABI_V4 || current_function_calls_eh_return))
-    rs6000_emit_allocate_stack (info->total_size, FALSE);
+    {
+      rs6000_emit_allocate_stack (info->total_size, FALSE);
+      sp_offset = info->total_size;
+    }
+  /* APPLE LOCAL end mainline */
 
   /* Set frame pointer, if needed.  */
   if (frame_pointer_needed)
@@ -16828,6 +16765,80 @@
       RTX_FRAME_RELATED_P (insn) = 1;
     }
 
+  /* APPLE LOCAL begin mainline */
+  /* Save AltiVec registers if needed.  Save here because the red zone does
+     not include AltiVec registers.  */
+  if (!WORLD_SAVE_P (info) && TARGET_ALTIVEC_ABI && info->altivec_size != 0)
+    {
+      int i;
+
+      /* There should be a non inline version of this, for when we
+         are saving lots of vector registers.  */
+      for (i = info->first_altivec_reg_save; i <= LAST_ALTIVEC_REGNO; ++i)
+        if (info->vrsave_mask & ALTIVEC_REG_BIT (i))
+          {
+            rtx areg, savereg, mem;
+            int offset;
+
+            offset = info->altivec_save_offset + sp_offset
+              + 16 * (i - info->first_altivec_reg_save);
+
+            savereg = gen_rtx_REG (V4SImode, i);
+
+            areg = gen_rtx_REG (Pmode, 0);
+            emit_move_insn (areg, GEN_INT (offset));
+
+            /* AltiVec addressing mode is [reg+reg].  */
+            mem = gen_frame_mem (V4SImode,
+                                 gen_rtx_PLUS (Pmode, frame_reg_rtx, areg));
+
+            insn = emit_move_insn (mem, savereg);
+
+            rs6000_frame_related (insn, frame_ptr_rtx, info->total_size,
+                                  areg, GEN_INT (offset));
+          }
+    }
+
+  /* VRSAVE is a bit vector representing which AltiVec registers
+     are used.  The OS uses this to determine which vector
+     registers to save on a context switch.  We need to save
+     VRSAVE on the stack frame, add whatever AltiVec registers we
+     used in this function, and do the corresponding magic in the
+     epilogue.  */
+
+  if (TARGET_ALTIVEC && TARGET_ALTIVEC_VRSAVE
+      && info->vrsave_mask != 0)
+    {
+      rtx reg, mem, vrsave;
+      int offset;
+
+      /* Get VRSAVE onto a GPR.  Note that ABI_V4 might be using r12
+         as frame_reg_rtx and r11 as the static chain pointer for
+         nested functions.  */
+      reg = gen_rtx_REG (SImode, 0);
+      vrsave = gen_rtx_REG (SImode, VRSAVE_REGNO);
+      if (TARGET_MACHO)
+        emit_insn (gen_get_vrsave_internal (reg));
+      else
+        emit_insn (gen_rtx_SET (VOIDmode, reg, vrsave));
+
+      if (!WORLD_SAVE_P (info))
+        {
+          /* Save VRSAVE.  */
+          offset = info->vrsave_save_offset + sp_offset;
+          mem = gen_frame_mem (SImode,
+                               gen_rtx_PLUS (Pmode, frame_reg_rtx,
+                                             GEN_INT (offset)));
+          insn = emit_move_insn (mem, reg);
+        }
+
+      /* Include the registers in the mask.  */
+      emit_insn (gen_iorsi3 (reg, reg, GEN_INT ((int) info->vrsave_mask)));
+
+      insn = emit_insn (generate_set_vrsave (reg, info, 0));
+    }
+
+  /* APPLE LOCAL end mainline */
   /* If we are using RS6000_PIC_OFFSET_TABLE_REGNUM, we need to set it up.  */
   if ((TARGET_TOC && TARGET_MINIMAL_TOC && get_pool_size () != 0)
       || (DEFAULT_ABI == ABI_V4
@@ -17116,33 +17127,11 @@
       return;
     }
 
-  /* If we have a frame pointer, a call to alloca,  or a large stack
-     frame, restore the old stack pointer using the backchain.  Otherwise,
-     we know what size to update it with.  */
-  if (use_backchain_to_restore_sp)
-    {
-      /* Under V.4, don't reset the stack pointer until after we're done
-	 loading the saved registers.  */
-      if (DEFAULT_ABI == ABI_V4)
-	frame_reg_rtx = gen_rtx_REG (Pmode, 11);
-
-      emit_move_insn (frame_reg_rtx,
-		      gen_rtx_MEM (Pmode, sp_reg_rtx));
-    }
-  else if (info->push_p)
-    {
-      if (DEFAULT_ABI == ABI_V4
-	  || current_function_calls_eh_return)
+  /* APPLE LOCAL begin mainline */
+  /* Set sp_offset based on the stack push from the prologue.  */
+  if ((DEFAULT_ABI == ABI_V4 || current_function_calls_eh_return)
+      && info->total_size < 32767)
 	sp_offset = info->total_size;
-      else
-	{
-	  emit_insn (TARGET_32BIT
-		     ? gen_addsi3 (sp_reg_rtx, sp_reg_rtx,
-				   GEN_INT (info->total_size))
-		     : gen_adddi3 (sp_reg_rtx, sp_reg_rtx,
-				   GEN_INT (info->total_size)));
-	}
-    }
 
   /* Restore AltiVec registers if needed.  */
   if (TARGET_ALTIVEC_ABI && info->altivec_size != 0)
@@ -17183,6 +17172,37 @@
       emit_insn (generate_set_vrsave (reg, info, 1));
     }
 
+  sp_offset = 0;
+
+  /* If we have a frame pointer, a call to alloca,  or a large stack
+     frame, restore the old stack pointer using the backchain.  Otherwise,
+     we know what size to update it with.  */
+  if (use_backchain_to_restore_sp)
+    {
+      /* Under V.4, don't reset the stack pointer until after we're done
+	 loading the saved registers.  */
+      if (DEFAULT_ABI == ABI_V4)
+	frame_reg_rtx = gen_rtx_REG (Pmode, 11);
+
+      emit_move_insn (frame_reg_rtx,
+		      gen_rtx_MEM (Pmode, sp_reg_rtx));
+    }
+  else if (info->push_p)
+    {
+      if (DEFAULT_ABI == ABI_V4
+	  || current_function_calls_eh_return)
+	sp_offset = info->total_size;
+      else
+	{
+	  emit_insn (TARGET_32BIT
+		     ? gen_addsi3 (sp_reg_rtx, sp_reg_rtx,
+				   GEN_INT (info->total_size))
+		     : gen_adddi3 (sp_reg_rtx, sp_reg_rtx,
+				   GEN_INT (info->total_size)));
+	}
+    }
+
+  /* APPLE LOCAL end mainline */
   /* Get the old lr if we saved it.  */
   if (info->lr_save_p)
     {
@@ -17275,7 +17295,7 @@
 			   && cfun->machine->substitute_pic_base_reg
 			   == INVALID_REGNUM)
 			  || cfun->machine->ra_needs_full_frame)))))
-		
+
 		  /* APPLE LOCAL end darwin native */
 	{
 	  rtx addr = gen_rtx_PLUS (Pmode, frame_reg_rtx,

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Extraneous changes
  2007-05-18  5:58 Extraneous changes Mike Stump
@ 2007-05-18  7:56 ` Eric Christopher
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Christopher @ 2007-05-18  7:56 UTC (permalink / raw)
  To: Mike Stump; +Cc: gcc-patches


On May 17, 2007, at 10:58 PM, Mike Stump wrote:

> Eric, in your recent patch, you put in the below...  :-(
>
> This bears little relationship with the patch that you emailed out.
> Please adjust your email proceedure to include the output of svn diff
> of the thing that you want to check in.  I'm happy to reject it, but
> can't, if I can't see what you want to put in.  If you edit a patch
> post emailing it out and before you check it in, send the updated
> patch out.
>
> Also, review the output of svn diff just before checking in.
>
> Also, please attach the patches to the radars.
>

Actually, I fixed it post checkin after I noticed.

-eric

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-05-18  7:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-18  5:58 Extraneous changes Mike Stump
2007-05-18  7:56 ` Eric Christopher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).