This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch to gcc/resource.c for PR target/13256, CRIS, SH, reorg,dbr, strict_low_part.
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- To: wilson at specifixinc dot com
- Cc: scox at redhat dot com, gcc-patches at gcc dot gnu dot org
- Date: Fri, 5 Dec 2003 13:00:53 +0100
- Subject: Re: Patch to gcc/resource.c for PR target/13256, CRIS, SH, reorg,dbr, strict_low_part.
> Date: Thu, 04 Dec 2003 16:08:40 -0800
> From: Jim Wilson <wilson@specifixinc.com>
> However, I think a simpler solution here is to just drop the MARK_DEST
> support. There is no place in the compiler that uses MARK_DEST, so we
> can get rid of it. Once we do that, resource.c goes back to what it
> looked in in gcc-2.95 and earlier. The strict_low_part case can be
> deleted, since now the fall through code at the end handles it
> correctly. We still need the zero_extract/sign_extract, case, because
> we need to pass 0 for in_dest for operands 1 and 2, but there is no if
> statement needed here. Likewise for the SET_SRC code in the SET case.
Thank you for the review.
Your detailed suggestion made the following patch an obvious
matter, thus committed. Tested on cris-axis-elf, sh-unknown-elf
and mips-unknown-elf (delay_slot targets) with simulators.
(mips and sh were at LAST_UPDATED "Tue Nov 25 20:39:13 GMT 2003"
in shoddy shape wrt. C++ but nonetheless).
Test-case committed as previously posted (testcases are covered
by port maintainer authority; I just didn't want to XFAIL it
before).
I'd like to put this in the 3.3 branch too.
PR target/13256
* resource.h (enum mark_resource_type): Remove member MARK_DEST.
The only user changed as follows:
* resource.c (mark_set_resources) <case SET>: Always recurse for
SET_SRC (x).
<case SIGN_EXTRACT, case ZERO_EXTRACT>: Always recurse on
operands.
<case STRICT_LOW_PART>: Delete, deferring to default code.
Index: resource.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/resource.c,v
retrieving revision 1.63
diff -p -c -r1.63 resource.c
*** resource.c 19 Jul 2003 14:47:13 -0000 1.63
--- resource.c 5 Dec 2003 11:42:53 -0000
*************** find_dead_or_set_registers (rtx target,
*** 616,622 ****
/* Given X, a part of an insn, and a pointer to a `struct resource',
RES, indicate which resources are modified by the insn. If
MARK_TYPE is MARK_SRC_DEST_CALL, also mark resources potentially
! set by the called routine. If MARK_TYPE is MARK_DEST, only mark SET_DESTs
If IN_DEST is nonzero, it means we are inside a SET. Otherwise,
objects are being referenced instead of set.
--- 616,622 ----
/* Given X, a part of an insn, and a pointer to a `struct resource',
RES, indicate which resources are modified by the insn. If
MARK_TYPE is MARK_SRC_DEST_CALL, also mark resources potentially
! set by the called routine.
If IN_DEST is nonzero, it means we are inside a SET. Otherwise,
objects are being referenced instead of set.
*************** mark_set_resources (rtx x, struct resour
*** 716,723 ****
|| GET_CODE (SET_SRC (x)) != CALL),
mark_type);
! if (mark_type != MARK_DEST)
! mark_set_resources (SET_SRC (x), res, 0, MARK_SRC_DEST);
return;
case CLOBBER:
--- 716,722 ----
|| GET_CODE (SET_SRC (x)) != CALL),
mark_type);
! mark_set_resources (SET_SRC (x), res, 0, MARK_SRC_DEST);
return;
case CLOBBER:
*************** mark_set_resources (rtx x, struct resour
*** 747,758 ****
case SIGN_EXTRACT:
case ZERO_EXTRACT:
! if (! (mark_type == MARK_DEST && in_dest))
! {
! mark_set_resources (XEXP (x, 0), res, in_dest, MARK_SRC_DEST);
! mark_set_resources (XEXP (x, 1), res, 0, MARK_SRC_DEST);
! mark_set_resources (XEXP (x, 2), res, 0, MARK_SRC_DEST);
! }
return;
case MEM:
--- 746,754 ----
case SIGN_EXTRACT:
case ZERO_EXTRACT:
! mark_set_resources (XEXP (x, 0), res, in_dest, MARK_SRC_DEST);
! mark_set_resources (XEXP (x, 1), res, 0, MARK_SRC_DEST);
! mark_set_resources (XEXP (x, 2), res, 0, MARK_SRC_DEST);
return;
case MEM:
*************** mark_set_resources (rtx x, struct resour
*** 798,810 ****
SET_HARD_REG_BIT (res->regs, r);
}
return;
-
- case STRICT_LOW_PART:
- if (! (mark_type == MARK_DEST && in_dest))
- {
- mark_set_resources (XEXP (x, 0), res, 0, MARK_SRC_DEST);
- return;
- }
case UNSPEC_VOLATILE:
case ASM_INPUT:
--- 794,799 ----
Index: resource.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/resource.h,v
retrieving revision 1.10
diff -p -c -r1.10 resource.h
*** resource.h 6 Jul 2003 09:56:08 -0000 1.10
--- resource.h 5 Dec 2003 11:42:53 -0000
*************** struct resources
*** 37,44 ****
enum mark_resource_type
{
MARK_SRC_DEST = 0,
! MARK_SRC_DEST_CALL = 1,
! MARK_DEST = 2
};
extern void mark_target_live_regs (rtx, rtx, struct resources *);
--- 37,43 ----
enum mark_resource_type
{
MARK_SRC_DEST = 0,
! MARK_SRC_DEST_CALL = 1
};
extern void mark_target_live_regs (rtx, rtx, struct resources *);
brgds, H-P