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]

[PATCH] Fix bootstrap/10983


The patch was bootstrapped/regtested (c,c++,objc,f77,java) on x86, SPARC32 
and SPARC64 with no new regressions, at least for the first four languages. 
Ok for mainline?

-- 
Eric Botcazou


2003-06-13  Jim Wilson <wilson@tuliptree.org>
                  Eric Botcazou  <ebotcazou@libertysurf.fr>

	PR bootstrap/10983
	* combine.c (make_extraction): Use gen_lowpart_for_combine
	when extracting from a REG and not in the destination of a SET.
Index: combine.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/combine.c,v
retrieving revision 1.362
diff -c -p -r1.362 combine.c
*** combine.c	8 Jun 2003 19:35:51 -0000	1.362
--- combine.c	13 Jun 2003 06:50:56 -0000
*************** make_extraction (enum machine_mode mode,
*** 6139,6168 ****
  	}
        else if (GET_CODE (inner) == REG)
  	{
- 	  /* We can't call gen_lowpart_for_combine here since we always want
- 	     a SUBREG and it would sometimes return a new hard register.  */
  	  if (tmode != inner_mode)
  	    {
! 	      HOST_WIDE_INT final_word = pos / BITS_PER_WORD;
  
! 	      if (WORDS_BIG_ENDIAN
! 		  && GET_MODE_SIZE (inner_mode) > UNITS_PER_WORD)
! 		final_word = ((GET_MODE_SIZE (inner_mode)
! 			       - GET_MODE_SIZE (tmode))
! 			      / UNITS_PER_WORD) - final_word;
  
! 	      final_word *= UNITS_PER_WORD;
! 	      if (BYTES_BIG_ENDIAN &&
! 		  GET_MODE_SIZE (inner_mode) > GET_MODE_SIZE (tmode))
! 		final_word += (GET_MODE_SIZE (inner_mode)
! 			       - GET_MODE_SIZE (tmode)) % UNITS_PER_WORD;
  
! 	      /* Avoid creating invalid subregs, for example when
! 		 simplifying (x>>32)&255.  */
! 	      if (final_word >= GET_MODE_SIZE (inner_mode))
! 		return NULL_RTX;
  
! 	      new = gen_rtx_SUBREG (tmode, inner, final_word);
  	    }
  	  else
  	    new = inner;
--- 6139,6173 ----
  	}
        else if (GET_CODE (inner) == REG)
  	{
  	  if (tmode != inner_mode)
  	    {
! 	      if (in_dest)
! 		{
! 		  /* We can't call gen_lowpart_for_combine here since we always want
! 		     a SUBREG and it would sometimes return a new hard register.  */
! 		  HOST_WIDE_INT final_word = pos / BITS_PER_WORD;
  
! 		  if (WORDS_BIG_ENDIAN
! 		      && GET_MODE_SIZE (inner_mode) > UNITS_PER_WORD)
! 		    final_word = ((GET_MODE_SIZE (inner_mode)
! 				   - GET_MODE_SIZE (tmode))
! 				  / UNITS_PER_WORD) - final_word;
  
! 		  final_word *= UNITS_PER_WORD;
! 		  if (BYTES_BIG_ENDIAN &&
! 		      GET_MODE_SIZE (inner_mode) > GET_MODE_SIZE (tmode))
! 		    final_word += (GET_MODE_SIZE (inner_mode)
! 				   - GET_MODE_SIZE (tmode)) % UNITS_PER_WORD;
  
! 		  /* Avoid creating invalid subregs, for example when
! 		     simplifying (x>>32)&255.  */
! 		  if (final_word >= GET_MODE_SIZE (inner_mode))
! 		    return NULL_RTX;
  
! 		  new = gen_rtx_SUBREG (tmode, inner, final_word);
! 		}
! 	      else
! 		new = gen_lowpart_for_combine (tmode, inner);
  	    }
  	  else
  	    new = inner;

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