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]

combine patch



I've installed this to fix a code generation error for our mips64 ports.  We
incorrectly eliminated a TRUNCATE operation.


        * combine.c (simplify_rtx): Do not replace TRUNCATE with a SUBREG if
        truncation is not a no-op.

Index: combine.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/combine.c,v
retrieving revision 1.185
diff -c -3 -p -r1.185 combine.c
*** combine.c	1998/09/16 05:48:22	1.185
--- combine.c	1998/10/05 16:02:53
*************** simplify_rtx (x, op0_mode, last, in_dest
*** 3891,3899 ****
  	return SUBREG_REG (XEXP (x, 0));
  
        /* If we know that the value is already truncated, we can
!          replace the TRUNCATE with a SUBREG.  */
!       if (num_sign_bit_copies (XEXP (x, 0), GET_MODE (XEXP (x, 0)))
! 	  >= GET_MODE_BITSIZE (mode) + 1)
  	return gen_lowpart_for_combine (mode, XEXP (x, 0));
  
        /* A truncate of a comparison can be replaced with a subreg if
--- 3891,3902 ----
  	return SUBREG_REG (XEXP (x, 0));
  
        /* If we know that the value is already truncated, we can
!          replace the TRUNCATE with a SUBREG if TRULY_NOOP_TRUNCATION is
! 	 nonzero for the corresponding modes.  */
!       if (TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (mode),
! 				 GET_MODE_BITSIZE (GET_MODE (XEXP (x, 0))))
! 	  && num_sign_bit_copies (XEXP (x, 0), GET_MODE (XEXP (x, 0)))
! 	     >= GET_MODE_BITSIZE (mode) + 1)
  	return gen_lowpart_for_combine (mode, XEXP (x, 0));
  
        /* A truncate of a comparison can be replaced with a subreg if


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