[patch] Make gen_highpart work for constants

Roman Lechtchinsky rl@cs.tu-berlin.de
Fri Jun 22 04:29:00 GMT 2001


This patch makes gen_highpart work for constants again. It simply
reinstalls the old code which deals with CONST_INTs and CONST_DOUBLEs.
sparc-sun-solaris2.7 almost bootstraps with this - there is a problem with
libstdc++ which I'm about to investigate. Since Solaris won't get past
stage1 without the patch and I don't have access to other architectures at
the moment, I can't do any regression testing, unfortunately.

2001-06-22  Roman Lechtchinsky  <rl@cs.tu-berlin.de>

	* emit-rtl.c (gen_highpart): Make it work for CONST_INT and
	CONST_DOUBLE.

Index: emit-rtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/emit-rtl.c,v
retrieving revision 1.182
diff -c -3 -p -r1.182 emit-rtl.c
*** emit-rtl.c	2001/06/19 08:34:34	1.182
--- emit-rtl.c	2001/06/22 11:21:16
*************** gen_highpart (mode, x)
*** 1133,1140 ****
        && msize != GET_MODE_UNIT_SIZE (GET_MODE (x)))
      abort ();
  
!   result = simplify_gen_subreg (mode, x, GET_MODE (x),
! 				subreg_highpart_offset (mode, GET_MODE (x)));
    if (!result)
      abort ();
    return result;
--- 1133,1155 ----
        && msize != GET_MODE_UNIT_SIZE (GET_MODE (x)))
      abort ();
  
!   if (GET_CODE (x) == CONST_DOUBLE
! #if !(TARGET_FLOAT_FORMAT != HOST_FLOAT_FORMAT || defined (REAL_IS_NOT_DOUBLE))
!       && GET_MODE_CLASS (GET_MODE (x)) != MODE_FLOAT
! #endif
!       )
!     result = GEN_INT (CONST_DOUBLE_HIGH (x) & GET_MODE_MASK (mode));
!   if (GET_CODE (x) == CONST_INT)
!     {
!       if (HOST_BITS_PER_WIDE_INT <= BITS_PER_WORD)
! 	result = const0_rtx;
!       else
! 	result = GEN_INT (INTVAL (x) 
! 			  >> (HOST_BITS_PER_WIDE_INT - BITS_PER_WORD));
!     }
!   else
!     result = simplify_gen_subreg (mode, x, GET_MODE (x),
! 				  subreg_highpart_offset (mode, GET_MODE (x)));
    if (!result)
      abort ();
    return result;



More information about the Gcc-patches mailing list