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 for IA64 HP-UX


On the HP-UX IA64 platform (in ILP32 mode with optimization),
expand_builtin_stpcpy was getting called with a NULL target and a
VOIDmode mode.  I believe this is legal since they are just
recommendations and not requirements but it was resulting in
expand_builtin_stpcpy creating a VOIDmode register and then a SUBREG
from that and that was resulting in an internal compiler error in
simplify_gen_subreg.  This patch checks if mode is VOIDmode and if it is
uses the mode of ret to create the needed register instead of using
VOIDmode, it fixes:

	gcc.c-torture/compile/20030518-1.c
	gcc.c-torture/execute/builtins/strpcpy.c
	gcc.c-torture/execute/builtins/strpcpy-2.c


2004-07-15  Steve Ellcey  <sje@cup.hp.com>

	* builtins.c (expand_builtin_stpcpy): Do not create temporary
	reg with VOIDmode.


*** gcc.orig/gcc/gcc/builtins.c	Thu Jul 15 08:41:05 2004
--- gcc/gcc/gcc/builtins.c	Thu Jul 15 08:41:22 2004
*************** expand_builtin_stpcpy (tree arglist, rtx
*** 3139,3145 ****
  	      if (ret)
  		{
  		  if (! target)
! 		    target = gen_reg_rtx (mode);
  		  if (GET_MODE (target) != GET_MODE (ret))
  		    ret = gen_lowpart (GET_MODE (target), ret);
  
--- 3139,3150 ----
  	      if (ret)
  		{
  		  if (! target)
! 		    {
! 		      if (mode != VOIDmode)
! 			target = gen_reg_rtx (mode);
! 		      else
! 			target = gen_reg_rtx (GET_MODE (ret));
! 		    }
  		  if (GET_MODE (target) != GET_MODE (ret))
  		    ret = gen_lowpart (GET_MODE (target), ret);
  


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