Commit 82305258 by Andrew Haley Committed by Andrew Haley

mips.c (machine_dependent_reorg): Force a barrier to output the local constant pool if...

Fri Aug 20 13:43:41 1999  Andrew Haley  <aph@cygnus.com>

	* config/mips/mips.c (machine_dependent_reorg): Force a
	barrier to output the local constant pool if a barrier hasn't
	been found at a natural point in the instruction stream.

From-SVN: r29004
parent 04b9e2bf
Fri Aug 20 13:43:41 1999 Andrew Haley <aph@cygnus.com>
* config/mips/mips.c (machine_dependent_reorg): Force a
barrier to output the local constant pool if a barrier hasn't
been found at a natural point in the instruction stream.
Mon Aug 30 22:04:36 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> Mon Aug 30 22:04:36 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* c-parse.in (language_string): Constify. * c-parse.in (language_string): Constify.
......
...@@ -8372,7 +8372,7 @@ void ...@@ -8372,7 +8372,7 @@ void
machine_dependent_reorg (first) machine_dependent_reorg (first)
rtx first; rtx first;
{ {
int insns_len, max_internal_pool_size, pool_size, addr; int insns_len, max_internal_pool_size, pool_size, addr, first_constant_ref;
rtx insn; rtx insn;
struct constant *constants; struct constant *constants;
...@@ -8440,6 +8440,7 @@ machine_dependent_reorg (first) ...@@ -8440,6 +8440,7 @@ machine_dependent_reorg (first)
constants = NULL; constants = NULL;
addr = 0; addr = 0;
first_constant_ref = -1;
for (insn = first; insn; insn = NEXT_INSN (insn)) for (insn = first; insn; insn = NEXT_INSN (insn))
{ {
...@@ -8498,6 +8499,9 @@ machine_dependent_reorg (first) ...@@ -8498,6 +8499,9 @@ machine_dependent_reorg (first)
SET_DEST (PATTERN (insn)), SET_DEST (PATTERN (insn)),
newsrc); newsrc);
INSN_CODE (insn) = -1; INSN_CODE (insn) = -1;
if (first_constant_ref < 0)
first_constant_ref = addr;
} }
} }
...@@ -8529,27 +8533,33 @@ machine_dependent_reorg (first) ...@@ -8529,27 +8533,33 @@ machine_dependent_reorg (first)
if (constants != NULL) if (constants != NULL)
dump_constants (constants, insn); dump_constants (constants, insn);
constants = NULL; constants = NULL;
first_constant_ref = -1;
} }
if (constants != NULL
&& (NEXT_INSN (insn) == NULL
|| (first_constant_ref >= 0
&& (((addr - first_constant_ref)
+ 2 /* for alignment */
+ 2 /* for a short jump insn */
+ pool_size)
>= 0x8000))))
{
/* If we haven't had a barrier within 0x8000 bytes of a
constant reference or we are at the end of the function,
emit a barrier now. */
/* ??? If we don't find a barrier within 0x8000 bytes of rtx label, jump, barrier;
instructions and constants in CONSTANTS, we need to invent
one. This seems sufficiently unlikely that I am not going to label = gen_label_rtx ();
worry about it. */ jump = emit_jump_insn_after (gen_jump (label), insn);
} JUMP_LABEL (jump) = label;
LABEL_NUSES (label) = 1;
if (constants != NULL) barrier = emit_barrier_after (jump);
{ emit_label_after (label, barrier);
rtx label, jump, barrier; first_constant_ref = -1;
}
label = gen_label_rtx (); }
jump = emit_jump_insn_after (gen_jump (label), get_last_insn ());
JUMP_LABEL (jump) = label;
LABEL_NUSES (label) = 1;
barrier = emit_barrier_after (jump);
emit_label_after (label, barrier);
dump_constants (constants, barrier);
constants = NULL;
}
/* ??? If we output all references to a constant in internal /* ??? If we output all references to a constant in internal
constants table, we don't need to output the constant in the real constants table, we don't need to output the constant in the real
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment