This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Unreviewed patch (was Re: Freeze timing and questions)


Richard Henderson wrote:

> Due to patch review backlog, I think that anything posted to 
> gcc-patches before last Friday should be given a fair chance.
> That said, these leftovers should be addressed promptly, and
> if someone has one outstanding they should send prodding mail.

I'd really like to get the port for Tensilica's Xtensa processors into 
the 3.1 release.  I submitted the changes for the 3.0 branch but was too 
late for 3.0.3.  For 3.1, there are some minor problems in the 
Xtensa-specific files that I would like to clean up before sending in 
those files.  I assume I can add those after the freeze, but I also need 
a small set of changes outside the Xtensa-specific files.  These are the 
same as part 3 of the patches that I requested for the 3.0 branch 
(http://gcc.gnu.org/ml/gcc-patches/2001-11/msg02104.html), and no one 
has yet responded to my requests to review them.

So, here is your prodding mail, and another copy of the patches that 
should apply cleanly to the 3.1 tree.  Would someone please review these 
and make the changes for me?  I don't have CVS write permission yet so I 
can't actually commit the changes.

Please see my original mail (linked above) for the changelog entries and 
explanations.  In summary, there are 3 changes:

cse.c: a very safe and simple change that is essential for making the 
Xtensa port work at all

integrate.c: a bug fix that only affects Xtensa, dealing with having the 
static chain in memory

varasm.c: adding a new hook -- this seemed like the cleanest solution to 
me, but if someone can suggest an alternative, that would be fine with me.

The updated patches for the 3.1 tree are attached.


Index: cse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cse.c,v
retrieving revision 1.214
diff -c -r1.214 cse.c
*** cse.c	2001/11/28 09:47:23	1.214
--- cse.c	2001/12/19 00:29:33
***************
*** 2272,2281 ****
  		|| CLASS_LIKELY_SPILLED_P (REGNO_REG_CLASS (regno))
  		|| (SMALL_REGISTER_CLASSES
  		    && ! fixed_regs[regno]
! 		    && regno != FRAME_POINTER_REGNUM
! 		    && regno != HARD_FRAME_POINTER_REGNUM
! 		    && regno != ARG_POINTER_REGNUM
! 		    && regno != STACK_POINTER_REGNUM
  		    && GET_MODE_CLASS (GET_MODE (x)) != MODE_CC)))
  	  {
  	    do_not_record = 1;
--- 2272,2281 ----
  		|| CLASS_LIKELY_SPILLED_P (REGNO_REG_CLASS (regno))
  		|| (SMALL_REGISTER_CLASSES
  		    && ! fixed_regs[regno]
! 		    && x != frame_pointer_rtx
! 		    && x != hard_frame_pointer_rtx
! 		    && x != arg_pointer_rtx
! 		    && x != stack_pointer_rtx
  		    && GET_MODE_CLASS (GET_MODE (x)) != MODE_CC)))
  	  {
  	    do_not_record = 1;
Index: integrate.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/integrate.c,v
retrieving revision 1.176
diff -c -r1.176 integrate.c
*** integrate.c	2001/11/15 03:02:23	1.176
--- integrate.c	2001/12/19 00:29:48
***************
*** 1318,1323 ****
--- 1318,1324 ----
  #ifdef HAVE_cc0
    rtx cc0_insn = 0;
  #endif
+   rtx static_chain_mem = 0;
  
    /* Copy the insns one by one.  Do this in two passes, first the insns and
       then their REG_NOTES.  */
***************
*** 1381,1405 ****
  		   && REG_FUNCTION_VALUE_P (XEXP (pattern, 0)))
  	    break;
  
! 	  /* If this is setting the static chain rtx, omit it.  */
  	  else if (static_chain_value != 0
  		   && set != 0
  		   && GET_CODE (SET_DEST (set)) == REG
! 		   && rtx_equal_p (SET_DEST (set),
! 				   static_chain_incoming_rtx))
  	    break;
  
  	  /* If this is setting the static chain pseudo, set it from
  	     the value we want to give it instead.  */
  	  else if (static_chain_value != 0
  		   && set != 0
! 		   && rtx_equal_p (SET_SRC (set),
! 				   static_chain_incoming_rtx))
  	    {
  	      rtx newdest = copy_rtx_and_substitute (SET_DEST (set), map, 1);
  
  	      copy = emit_move_insn (newdest, static_chain_value);
! 	      static_chain_value = 0;
  	    }
  
  	  /* If this is setting the virtual stack vars register, this must
--- 1382,1443 ----
  		   && REG_FUNCTION_VALUE_P (XEXP (pattern, 0)))
  	    break;
  
! 	  /* Look for the address of the static chain slot. The
!              rtx_equal_p comparisons against the
!              static_chain_incoming_rtx below may fail if the static
!              chain is in memory and the address specified is not
!              "legitimate".  This happens on Xtensa where the static
!              chain is at a negative offset from argp and where only
!              positive offsets are legitimate.  When the RTL is
!              generated, the address is "legitimized" by copying it
!              into a register, causing the rtx_equal_p comparisons to
!              fail.  This workaround looks for code that sets a
!              register to the address of the static chain.  Subsequent
!              memory references via that register can then be
!              identified as static chain references.  We assume that
!              the register is only assigned once, and that the static
!              chain address is only live in one register at a time. */
! 
  	  else if (static_chain_value != 0
  		   && set != 0
+ 		   && GET_CODE (static_chain_incoming_rtx) == MEM
  		   && GET_CODE (SET_DEST (set)) == REG
! 		   && rtx_equal_p (SET_SRC (set),
! 				   XEXP (static_chain_incoming_rtx, 0)))
! 	    {
! 	      static_chain_mem =
! 		  gen_rtx_MEM (GET_MODE (static_chain_incoming_rtx),
! 			       SET_DEST (set));
! 
! 	      /* emit the instruction in case it is used for something
! 		 other than setting the static chain; if it's not used,
! 		 it can always be removed as dead code */
! 	      copy = emit_insn (copy_rtx_and_substitute (pattern, map, 0));
! 	    }
! 
! 	  /* If this is setting the static chain rtx, omit it.  */
! 	  else if (static_chain_value != 0
! 		   && set != 0
! 		   && (rtx_equal_p (SET_DEST (set),
! 				    static_chain_incoming_rtx)
! 		       || (static_chain_mem
! 			   && rtx_equal_p (SET_DEST (set), static_chain_mem))))
  	    break;
  
  	  /* If this is setting the static chain pseudo, set it from
  	     the value we want to give it instead.  */
  	  else if (static_chain_value != 0
  		   && set != 0
! 		   && (rtx_equal_p (SET_SRC (set),
! 				    static_chain_incoming_rtx)
! 		       || (static_chain_mem
! 			   && rtx_equal_p (SET_SRC (set), static_chain_mem))))
  	    {
  	      rtx newdest = copy_rtx_and_substitute (SET_DEST (set), map, 1);
  
  	      copy = emit_move_insn (newdest, static_chain_value);
! 	      if (GET_CODE (static_chain_incoming_rtx) != MEM)
! 		static_chain_value = 0;
  	    }
  
  	  /* If this is setting the virtual stack vars register, this must
Index: varasm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/varasm.c,v
retrieving revision 1.236
diff -c -r1.236 varasm.c
*** varasm.c	2001/12/17 15:05:22	1.236
--- varasm.c	2001/12/19 00:29:58
***************
*** 1273,1278 ****
--- 1273,1281 ----
  #ifdef ASM_DECLARE_FUNCTION_SIZE
    ASM_DECLARE_FUNCTION_SIZE (asm_out_file, fnname, decl);
  #endif
+ #ifdef ASM_OUTPUT_FUNCTION_END
+   ASM_OUTPUT_FUNCTION_END (asm_out_file, fnname, decl);
+ #endif
    if (! CONSTANT_POOL_BEFORE_FUNCTION)
      {
        output_constant_pool (fnname, decl);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]