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]

make_extraction fix



Hi
This is simple fix to combine to prefer ZERO_EXTENSION over SIGN_EXTENSION as
comment says (currently it does the oposite).  The bug was introduced by me
some time ago by not very curefull copying it from the other place.
Bootstraped on i386 with few code size improvements.

Honza
Sat Aug 26 14:38:22 CEST 2000  Jan Hubicka  <jh@suse.cz>
	* combine.c (make_extraction): Fix rtx_cost comparison to
	match the comment.
*** combine.c.orig	Sat Aug 26 11:41:35 2000
--- combine.c	Sat Aug 26 14:36:38 2000
*************** make_extraction (mode, inner, pos, pos_r
*** 6000,6008 ****
  	  rtx temp = gen_rtx_ZERO_EXTEND (mode, new);
  	  rtx temp1 = gen_rtx_SIGN_EXTEND (mode, new);
  
! 	  /* Prefer ZERO_EXTENSION, since it gives more information to
  	     backends.  */
! 	  if (rtx_cost (temp, SET) < rtx_cost (temp1, SET))
  	    return temp;
  	  return temp1;
  	}
--- 6000,6008 ----
  	  rtx temp = gen_rtx_ZERO_EXTEND (mode, new);
  	  rtx temp1 = gen_rtx_SIGN_EXTEND (mode, new);
  
! 	  /* Preffer ZERO_EXTENSION, since it gives more information to
  	     backends.  */
! 	  if (rtx_cost (temp, SET) <= rtx_cost (temp1, SET))
  	    return temp;
  	  return temp1;
  	}

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