egcs/gcc ChangeLog dwarf2out.c emit-rtl.c func ...

amacleod@gcc.gnu.org amacleod@gcc.gnu.org
Mon Oct 2 18:08:00 GMT 2000


CVSROOT:	/cvs/gcc
Module name:	egcs
Branch: 	subreg-byte-branch
Changes by:	amacleod@sourceware.cygnus.com	2000-10-02 18:08:37

Modified files:
	gcc            : ChangeLog dwarf2out.c emit-rtl.c function.c 
	                 reload.c 

Log message:
	2000-10-01  Andrew MacLeod  <amacleod@redhat.com>
	
	* dwarf2out.c (loc_descriptor): use SUBREG_REG to get the register.
	* emit-rtl.c (gen_lowpart_common, gen_imagpart): Spacing nits.
	(gen_highpart, constant_subword, operand_subword): Spacing nits.
	* function.c (purge_single_hard_subreg_set): Correct last change, find
	correct offsets for subreg.
	* reload.c (push_reload): Replace missing clause.
	
	Index: gcc/dwarf2out.c
	===================================================================
	RCS file: /cvs/gcc/egcs/gcc/dwarf2out.c,v
	retrieving revision 1.205.2.1
	diff -c -p -r1.205.2.1 dwarf2out.c
	*** dwarf2out.c	2000/09/24 22:21:31	1.205.2.1
	--- dwarf2out.c	2000/10/03 00:15:35
	*************** loc_descriptor (rtl)
	*** 7363,7369 ****
	up an entire register.  For now, just assume that it is
	legitimate to make the Dwarf info refer to the whole register which
	contains the given subreg.  */
	!       rtl = XEXP (rtl, 0);
	
	/* Fall through.  */
	
	--- 7363,7369 ----
	up an entire register.  For now, just assume that it is
	legitimate to make the Dwarf info refer to the whole register which
	contains the given subreg.  */
	!       rtl = SUBREG_REG (rtl);
	
	/* Fall through.  */
	
	Index: gcc/emit-rtl.c
	===================================================================
	RCS file: /cvs/gcc/egcs/gcc/emit-rtl.c,v
	retrieving revision 1.147.2.1
	diff -c -p -r1.147.2.1 emit-rtl.c
	*** emit-rtl.c	2000/09/24 22:21:31	1.147.2.1
	--- emit-rtl.c	2000/10/03 00:15:36
	*************** gen_lowpart_common (mode, x)
	*** 830,836 ****
	if (REGNO (x) < FIRST_PSEUDO_REGISTER)
	{
	int final_regno = REGNO (x) +
	! 	    SUBREG_REGNO_OFFSET(REGNO (x), GET_MODE (x), offset, mode);
	
	/* If the final regno is not valid for MODE, punt.  */
	/* ??? We do allow it if the current REG is not valid for
	--- 830,836 ----
	if (REGNO (x) < FIRST_PSEUDO_REGISTER)
	{
	int final_regno = REGNO (x) +
	! 	    SUBREG_REGNO_OFFSET (REGNO (x), GET_MODE (x), offset, mode);
	
	/* If the final regno is not valid for MODE, punt.  */
	/* ??? We do allow it if the current REG is not valid for
	*************** gen_imagpart (mode, x)
	*** 1127,1133 ****
	return XEXP (x, 1);
	else if (WORDS_BIG_ENDIAN)
	return gen_lowpart (mode, x);
	!   else if (!WORDS_BIG_ENDIAN
	&& GET_MODE_BITSIZE (mode) < BITS_PER_WORD
	&& REG_P (x)
	&& REGNO (x) < FIRST_PSEUDO_REGISTER)
	--- 1127,1133 ----
	return XEXP (x, 1);
	else if (WORDS_BIG_ENDIAN)
	return gen_lowpart (mode, x);
	!   else if (! WORDS_BIG_ENDIAN
	&& GET_MODE_BITSIZE (mode) < BITS_PER_WORD
	&& REG_P (x)
	&& REGNO (x) < FIRST_PSEUDO_REGISTER)
	*************** gen_highpart (mode, x)
	*** 1266,1272 ****
	if (REGNO (x) < FIRST_PSEUDO_REGISTER)
	{
	int final_regno = REGNO (x) +
	! 	    SUBREG_REGNO_OFFSET(REGNO (x), GET_MODE (x), offset, mode);
	
	/* integrate.c can't handle parts of a return value register.
	??? Then integrate.c should be fixed!
	--- 1266,1272 ----
	if (REGNO (x) < FIRST_PSEUDO_REGISTER)
	{
	int final_regno = REGNO (x) +
	! 	    SUBREG_REGNO_OFFSET (REGNO (x), GET_MODE (x), offset, mode);
	
	/* integrate.c can't handle parts of a return value register.
	??? Then integrate.c should be fixed!
	*************** constant_subword (op, offset, mode)
	*** 1377,1383 ****
	else if (BITS_PER_WORD == 16)
	{
	val = k[offset >> 1];
	! 	  if ((offset & 1) == !WORDS_BIG_ENDIAN)
	val >>= 16;
	val &= 0xffff;
	return GEN_INT (val);
	--- 1377,1383 ----
	else if (BITS_PER_WORD == 16)
	{
	val = k[offset >> 1];
	! 	  if ((offset & 1) == ! WORDS_BIG_ENDIAN)
	val >>= 16;
	val &= 0xffff;
	return GEN_INT (val);
	*************** constant_subword (op, offset, mode)
	*** 1405,1413 ****
	#if HOST_BITS_PER_WIDE_INT >= 64
	else if (BITS_PER_WORD >= 64 && offset <= 1)
	{
	! 	  val = k[offset*2 + ! WORDS_BIG_ENDIAN];
	val = (((val & 0xffffffff) ^ 0x80000000) - 0x80000000) << 32;
	! 	  val |= (HOST_WIDE_INT) k[offset*2 + WORDS_BIG_ENDIAN] & 0xffffffff;
	return GEN_INT (val);
	}
	#endif
	--- 1405,1413 ----
	#if HOST_BITS_PER_WIDE_INT >= 64
	else if (BITS_PER_WORD >= 64 && offset <= 1)
	{
	! 	  val = k[offset * 2 + ! WORDS_BIG_ENDIAN];
	val = (((val & 0xffffffff) ^ 0x80000000) - 0x80000000) << 32;
	! 	  val |= (HOST_WIDE_INT) k[offset * 2 + WORDS_BIG_ENDIAN] & 0xffffffff;
	return GEN_INT (val);
	}
	#endif
	*************** constant_subword (op, offset, mode)
	*** 1456,1462 ****
	
	if (BITS_PER_WORD == 16)
	{
	! 	  if ((offset & 1) == !WORDS_BIG_ENDIAN)
	val >>= 16;
	val &= 0xffff;
	}
	--- 1456,1462 ----
	
	if (BITS_PER_WORD == 16)
	{
	! 	  if ((offset & 1) == ! WORDS_BIG_ENDIAN)
	val >>= 16;
	val &= 0xffff;
	}
	*************** operand_subword (op, offset, validate_ad
	*** 1602,1608 ****
	if (REGNO (op) < FIRST_PSEUDO_REGISTER)
	{
	int final_regno = REGNO (op) +
	! 	    SUBREG_REGNO_OFFSET(REGNO (op), GET_MODE (op),
	offset * UNITS_PER_WORD,
	word_mode);
	
	--- 1602,1608 ----
	if (REGNO (op) < FIRST_PSEUDO_REGISTER)
	{
	int final_regno = REGNO (op) +
	! 	    SUBREG_REGNO_OFFSET (REGNO (op), GET_MODE (op),
	offset * UNITS_PER_WORD,
	word_mode);
	
	Index: gcc/function.c
	===================================================================
	RCS file: /cvs/gcc/egcs/gcc/function.c,v
	retrieving revision 1.220.2.2
	diff -c -p -r1.220.2.2 function.c
	*** function.c	2000/09/30 13:32:25	1.220.2.2
	--- function.c	2000/10/03 00:15:39
	*************** purge_single_hard_subreg_set (pattern)
	*** 3409,3418 ****
	{
	rtx reg = SET_DEST (pattern);
	enum machine_mode mode = GET_MODE (SET_DEST (pattern));
	
	!   if (GET_CODE (reg) == SUBREG && REGNO (reg) < FIRST_PSEUDO_REGISTER)
	{
	!       reg = gen_rtx_REG (mode, SUBREG_REGNO (reg));
	SET_DEST (pattern) = reg;
	}
	}
	--- 3409,3430 ----
	{
	rtx reg = SET_DEST (pattern);
	enum machine_mode mode = GET_MODE (SET_DEST (pattern));
	+   int offset = 0;
	+
	+   if (GET_CODE (reg) == SUBREG && GET_CODE (SUBREG_REG (reg)) == REG
	+       && REGNO (SUBREG_REG (reg)) < FIRST_PSEUDO_REGISTER)
	+     {
	+       offset = SUBREG_REGNO_OFFSET (REGNO (SUBREG_REG (reg)),
	+ 				    GET_MODE (SUBREG_REG (reg)),
	+ 				    SUBREG_BYTE (reg),
	+ 				    GET_MODE (reg));
	+       reg = SUBREG_REG (reg);
	+     }
	+
	
	!   if (REGNO (reg) < FIRST_PSEUDO_REGISTER)
	{
	!       reg = gen_rtx_REG (mode, REGNO (reg) + offset);
	SET_DEST (pattern) = reg;
	}
	}
	Index: gcc/reload.c
	===================================================================
	RCS file: /cvs/gcc/egcs/gcc/reload.c,v
	retrieving revision 1.130.2.2
	diff -c -p -r1.130.2.2 reload.c
	*** reload.c	2000/09/30 13:32:26	1.130.2.2
	--- reload.c	2000/10/03 00:15:41
	*************** push_reload (in, out, inloc, outloc, cla
	*** 1051,1056 ****
	--- 1051,1057 ----
	(except in the case of STRICT_LOW_PART,
	and in that case the constraint should label it input-output.)  */
	if (out != 0 && GET_CODE (out) == SUBREG
	+       && (SUBREG_BYTE (out) == 0 || strict_low)
	#ifdef CLASS_CANNOT_CHANGE_MODE
	&& (class != CLASS_CANNOT_CHANGE_MODE
	|| ! CLASS_CANNOT_CHANGE_MODE_P (GET_MODE (SUBREG_REG (out)),

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=subreg-byte-branch&r1=1.7852.2.1&r2=1.7852.2.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/dwarf2out.c.diff?cvsroot=gcc&only_with_tag=subreg-byte-branch&r1=1.205.2.1&r2=1.205.2.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/emit-rtl.c.diff?cvsroot=gcc&only_with_tag=subreg-byte-branch&r1=1.147.2.1&r2=1.147.2.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/function.c.diff?cvsroot=gcc&only_with_tag=subreg-byte-branch&r1=1.220.2.2&r2=1.220.2.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/reload.c.diff?cvsroot=gcc&only_with_tag=subreg-byte-branch&r1=1.130.2.2&r2=1.130.2.3



More information about the Gcc-cvs mailing list