summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>1998-09-20 23:29:09 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>1998-09-20 23:29:09 +0000
commit2a588794cf93b159760f128f2404ca5628d068aa (patch)
tree4cedb18879450264fbf3614257344386abf12fe5
parent1088838090262886b0211581818ae7a241e2857f (diff)
downloadppe42-gcc-2a588794cf93b159760f128f2404ca5628d068aa.tar.gz
ppe42-gcc-2a588794cf93b159760f128f2404ca5628d068aa.zip
* reload1.c (emit_reload_insns): Accept a new arg for the bb. Use
it to update bb boundaries. Update caller. * function.c (reposition_prologue_and_epilogue_notes): Update bb boundaries wrt the moved note. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@22507 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/function.c16
-rw-r--r--gcc/reload1.c32
3 files changed, 43 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2e90a70c60f..01893e99ebf 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+Sun Sep 20 23:28:11 1998 Richard Henderson <rth@cygnus.com>
+
+ * reload1.c (emit_reload_insns): Accept a new arg for the bb. Use
+ it to update bb boundaries. Update caller.
+ * function.c (reposition_prologue_and_epilogue_notes): Update
+ bb boundaries wrt the moved note.
+
Sun Sep 20 20:57:02 1998 Robert Lipe <robertl@dgii.com>
* configure.in (i*86-*-sysv5*): Use fixinc.svr4 to patch byteorder
diff --git a/gcc/function.c b/gcc/function.c
index c75648dbf30..99163e61a3c 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -6239,12 +6239,19 @@ reposition_prologue_and_epilogue_notes (f)
&& NOTE_LINE_NUMBER (note) == NOTE_INSN_PROLOGUE_END)
break;
}
+
next = NEXT_INSN (note);
prev = PREV_INSN (note);
if (prev)
NEXT_INSN (prev) = next;
if (next)
PREV_INSN (next) = prev;
+
+ /* Whether or not we can depend on basic_block_head,
+ attempt to keep it up-to-date. */
+ if (basic_block_head[0] == note)
+ basic_block_head[0] = next;
+
add_insn_after (note, insn);
}
}
@@ -6283,7 +6290,14 @@ reposition_prologue_and_epilogue_notes (f)
NEXT_INSN (prev) = next;
if (next)
PREV_INSN (next) = prev;
- add_insn_after (note, PREV_INSN (insn));
+
+ /* Whether or not we can depend on basic_block_head,
+ attempt to keep it up-to-date. */
+ if (n_basic_blocks
+ && basic_block_head[n_basic_blocks-1] == insn)
+ basic_block_head[n_basic_blocks-1] = note;
+
+ add_insn_before (note, insn);
}
}
}
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 98cbae0cbc8..d8eb32633bc 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -387,7 +387,7 @@ static int reload_reg_reaches_end_p PROTO((int, int, enum reload_type));
static int allocate_reload_reg PROTO((int, rtx, int, int));
static void choose_reload_regs PROTO((rtx, rtx));
static void merge_assigned_reloads PROTO((rtx));
-static void emit_reload_insns PROTO((rtx));
+static void emit_reload_insns PROTO((rtx, int));
static void delete_output_reload PROTO((rtx, int, rtx));
static void inc_for_reload PROTO((rtx, rtx, int));
static int constraint_accepts_reg_p PROTO((char *, rtx));
@@ -4219,7 +4219,7 @@ reload_as_needed (first, live_known)
/* Generate the insns to reload operands into or out of
their reload regs. */
- emit_reload_insns (insn);
+ emit_reload_insns (insn, this_block);
/* Substitute the chosen reload regs from reload_reg_rtx
into the insn's body (or perhaps into the bodies of other
@@ -6329,8 +6329,9 @@ merge_assigned_reloads (insn)
/* Output insns to reload values in and out of the chosen reload regs. */
static void
-emit_reload_insns (insn)
+emit_reload_insns (insn, bb)
rtx insn;
+ int bb;
{
register int j;
rtx input_reload_insns[MAX_RECOG_OPERANDS];
@@ -6345,7 +6346,7 @@ emit_reload_insns (insn)
rtx other_operand_reload_insns = 0;
rtx other_output_reload_insns[MAX_RECOG_OPERANDS];
rtx following_insn = NEXT_INSN (insn);
- rtx before_insn = insn;
+ rtx before_insn = PREV_INSN (insn);
int special;
/* Values to be put in spill_reg_store are put here first. */
rtx new_spill_reg_store[FIRST_PSEUDO_REGISTER];
@@ -7251,18 +7252,18 @@ emit_reload_insns (insn)
reloads for the operand. The RELOAD_OTHER output reloads are
output in descending order by reload number. */
- emit_insns_before (other_input_address_reload_insns, before_insn);
- emit_insns_before (other_input_reload_insns, before_insn);
+ emit_insns_before (other_input_address_reload_insns, insn);
+ emit_insns_before (other_input_reload_insns, insn);
for (j = 0; j < reload_n_operands; j++)
{
- emit_insns_before (inpaddr_address_reload_insns[j], before_insn);
- emit_insns_before (input_address_reload_insns[j], before_insn);
- emit_insns_before (input_reload_insns[j], before_insn);
+ emit_insns_before (inpaddr_address_reload_insns[j], insn);
+ emit_insns_before (input_address_reload_insns[j], insn);
+ emit_insns_before (input_reload_insns[j], insn);
}
- emit_insns_before (other_operand_reload_insns, before_insn);
- emit_insns_before (operand_reload_insns, before_insn);
+ emit_insns_before (other_operand_reload_insns, insn);
+ emit_insns_before (operand_reload_insns, insn);
for (j = 0; j < reload_n_operands; j++)
{
@@ -7272,6 +7273,15 @@ emit_reload_insns (insn)
emit_insns_before (other_output_reload_insns[j], following_insn);
}
+ /* Keep basic block info up to date. */
+ if (n_basic_blocks)
+ {
+ if (basic_block_head[bb] == insn)
+ basic_block_head[bb] = NEXT_INSN (before_insn);
+ if (basic_block_end[bb] == insn)
+ basic_block_end[bb] = PREV_INSN (following_insn);
+ }
+
/* Move death notes from INSN
to output-operand-address and output reload insns. */
#ifdef PRESERVE_DEATH_INFO_REGNO_P
OpenPOWER on IntegriCloud