This is the mail archive of the gcc@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]

Re: Bootstrap failure on ia64


Hi David,
> 	FYI, I receive the same error on PowerPC in the testsuite,
> although the compiler does bootstrap.  If not for the G++ bootstrap
> failure, you would have received this feedback much earlier.

Many thanks.  I now understand the cause of the failure and am
currently attempting to bootstrap and regression test the following
patch.

The issue is that in the second hunk, len_rtx is a constant integer
that wasn't handled by the first hunk.  We'd then end up calling
simplify_gen_binary(MINUS, VOIDmode, const_int, const_int) which
isn't able to do the constant folding itself.  I'll look into a
follow-up patch to see if simplify_gen_binary can be improved to
handle this case.  For the time being, the following patch should
fix the powerpc regressions, and probably also the ia64 bootstrap
failure.

Ok to commit to mainline if bootstrapping and regression testing
complete?  Once again my sincere apologies.



2003-05-19  Roger Sayle  <roger@eyesopen.com>

	* builtins.c (expand_builtin_memcpy):  Be careful to avoid
	calling simplify_gen_binary with constant arguments.


Index: builtins.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/builtins.c,v
retrieving revision 1.202
diff -c -3 -p -r1.202 builtins.c
*** builtins.c	18 May 2003 22:50:25 -0000	1.202
--- builtins.c	19 May 2003 16:22:01 -0000
*************** expand_builtin_memcpy (arglist, target,
*** 2311,2324 ****
  #endif
  	  if (endp)
  	    {
! 	      rtx result;
! 	      rtx delta = len_rtx;

  	      if (endp == 2)
! 		delta = GEN_INT (INTVAL (delta) - 1);

  	      result = simplify_gen_binary (PLUS, GET_MODE (dest_mem),
! 					    dest_mem, delta);
  	      return force_operand (result, NULL_RTX);
  	    }
  	  else
--- 2311,2323 ----
  #endif
  	  if (endp)
  	    {
! 	      rtx result = len_rtx;

  	      if (endp == 2)
! 		result = GEN_INT (INTVAL (result) - 1);

  	      result = simplify_gen_binary (PLUS, GET_MODE (dest_mem),
! 					    dest_mem, result);
  	      return force_operand (result, NULL_RTX);
  	    }
  	  else
*************** expand_builtin_memcpy (arglist, target,
*** 2347,2355 ****

  	  if (endp == 2)
  	    {
! 	      result = simplify_gen_binary (MINUS, GET_MODE (result),
! 					    result, const1_rtx);
! 	      result = force_operand (result, NULL_RTX);
  	    }

  	  result = simplify_gen_binary (PLUS, GET_MODE (dest_addr),
--- 2346,2359 ----

  	  if (endp == 2)
  	    {
! 	      if (GET_CODE (result) != CONST_INT)
! 		{
! 		  result = simplify_gen_binary (MINUS, GET_MODE (result),
! 						result, const1_rtx);
! 		  result = force_operand (result, NULL_RTX);
! 		}
! 	      else
! 		result = GEN_INT (INTVAL (result) - 1);
  	    }

  	  result = simplify_gen_binary (PLUS, GET_MODE (dest_addr),


Roger
--
Roger Sayle,                         E-mail: roger@eyesopen.com
OpenEye Scientific Software,         WWW: http://www.eyesopen.com/
Suite 1107, 3600 Cerrillos Road,     Tel: (+1) 505-473-7385
Santa Fe, New Mexico, 87507.         Fax: (+1) 505-473-0833


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