This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: RTL_FLAG_CHECK patch
- From: "David S. Miller" <davem at redhat dot com>
- To: law at redhat dot com
- Cc: dave at hiauly1 dot hia dot nrc dot ca, janis187 at us dot ibm dot com, thorpej at wasabisystems dot com, gcc-bugs at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Fri, 10 May 2002 13:01:48 -0700 (PDT)
- Subject: Re: RTL_FLAG_CHECK patch
- References: <20020510.121658.26959745.davem@redhat.com><1435.1021060327@porcupine.cygnus.com>
From: law@redhat.com
Date: Fri, 10 May 2002 13:52:07 -0600
In message <20020510.121658.26959745.davem@redhat.com>, "David S. Miller"
writes:
> There is a lot of code which assumes that the first instruction in a
> delay slot sequence emitted by reorg is a branch. Aparently PA
> ends up putting something different there or the port is using
> sequences for something outside of reorg.
It is possible to have a normal INSN with a delay slot on the PA.
Ok, I see how the PA millicode stuff works now.
Fixed as follows, installed on the mainline.
2002-05-10 David S. Miller <davem@redhat.com>
* rtl.h (INSN_ANNULLED_BRANCH_P): Accept INSN too, update comment.
(struct rtx_def): Update unchanging flag comment.
* doc/rtl.texi (INSN_ANNULLED_BRANCH_P): Update description.
* reorg.c (delete_from_delay_list): INSN_ANNULLED_BRANCH_P needs
to be handled to INSN too.
(dbr_schedule): Likewise.
* resource.c (next_insn_no_annul): Likewise.
--- ./doc/rtl.texi.~1~ Thu May 9 04:34:42 2002
+++ ./doc/rtl.texi Fri May 10 13:01:24 2002
@@ -397,11 +397,13 @@ Stored in the @code{unchanging} field an
@findex INSN_ANNULLED_BRANCH_P
@cindex @code{jump_insn} and @samp{/u}
@cindex @code{call_insn} and @samp{/u}
-@cindex @code{unchanging}, in @code{jump_insn} and @code{call_insn}
+@cindex @code{insn} and @samp{/u}
+@cindex @code{unchanging}, in @code{jump_insn}, @code{call_insn} and @code{insn}
@item INSN_ANNULLED_BRANCH_P (@var{x})
-In a @code{jump_insn} or @code{call_insn} indicates that the branch is
-an annulling one. See the discussion under @code{sequence} below.
-Stored in the @code{unchanging} field and printed as @samp{/u}.
+In a @code{jump_insn}, @code{call_insn}, or @code{insn} indicates
+that the branch is an annulling one. See the discussion under
+@code{sequence} below. Stored in the @code{unchanging} field and
+printed as @samp{/u}.
@findex INSN_DEAD_CODE_P
@cindex @code{insn} and @samp{/s}
--- ./rtl.h.~1~ Fri May 10 05:18:49 2002
+++ ./rtl.h Fri May 10 13:03:11 2002
@@ -140,7 +140,7 @@ struct rtx_def
1 in a SYMBOL_REF if it addresses something in the per-function
constants pool.
1 in a CALL_INSN, NOTE, or EXPR_LIST for a const or pure call.
- 1 in a JUMP_INSN or CALL_INSN of an annulling branch. */
+ 1 in a JUMP_INSN, CALL_INSN, or INSN of an annulling branch. */
unsigned int unchanging : 1;
/* 1 in a MEM or ASM_OPERANDS expression if the memory reference is volatile.
1 in an INSN, CALL_INSN, JUMP_INSN, CODE_LABEL, BARRIER, or NOTE
@@ -537,9 +537,9 @@ do { \
#define SIBLING_CALL_P(RTX) \
(RTL_FLAG_CHECK1("SIBLING_CALL_P", (RTX), CALL_INSN)->jump)
-/* 1 if RTX is an insn that is an annulling branch. */
+/* 1 if RTX is a jump_insn, call_insn, or insn that is an annulling branch. */
#define INSN_ANNULLED_BRANCH_P(RTX) \
- (RTL_FLAG_CHECK2("INSN_ANNULLED_BRANCH_P", (RTX), JUMP_INSN, CALL_INSN)->unchanging)
+ (RTL_FLAG_CHECK3("INSN_ANNULLED_BRANCH_P", (RTX), JUMP_INSN, CALL_INSN, INSN)->unchanging)
/* 1 if RTX is an insn that is dead code. Valid only for dead-code
elimination phase. */
--- ./reorg.c.~1~ Thu May 9 04:36:03 2002
+++ ./reorg.c Fri May 10 13:00:23 2002
@@ -618,7 +618,8 @@ delete_from_delay_slot (insn)
if (delay_list)
trial = emit_delay_sequence (trial, delay_list, XVECLEN (seq, 0) - 2);
else if (GET_CODE (trial) == JUMP_INSN
- || GET_CODE (trial) == CALL_INSN)
+ || GET_CODE (trial) == CALL_INSN
+ || GET_CODE (trial) == INSN)
INSN_ANNULLED_BRANCH_P (trial) = 0;
INSN_FROM_TARGET_P (insn) = 0;
@@ -3630,7 +3631,8 @@ dbr_schedule (first, file)
rtx target;
if (GET_CODE (insn) == JUMP_INSN
- || GET_CODE (insn) == CALL_INSN)
+ || GET_CODE (insn) == CALL_INSN
+ || GET_CODE (insn) == INSN)
INSN_ANNULLED_BRANCH_P (insn) = 0;
INSN_FROM_TARGET_P (insn) = 0;
--- ./resource.c.~1~ Thu May 9 07:50:06 2002
+++ ./resource.c Fri May 10 13:02:21 2002
@@ -175,7 +175,9 @@ next_insn_no_annul (insn)
{
/* If INSN is an annulled branch, skip any insns from the target
of the branch. */
- if (GET_CODE (insn) == JUMP_INSN
+ if ((GET_CODE (insn) == JUMP_INSN
+ || GET_CODE (insn) == CALL_INSN
+ || GET_CODE (insn) == INSN)
&& INSN_ANNULLED_BRANCH_P (insn)
&& NEXT_INSN (PREV_INSN (insn)) != insn)
{