summaryrefslogtreecommitdiff
path: root/gcc/local-alloc.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1999-04-10 02:55:36 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1999-04-10 02:55:36 +0000
commit7d30a7b0f70c1982a254a4e8d7f0a299dfed3520 (patch)
tree224a58188d16a5c87219ebe17fc74ad7dc836b76 /gcc/local-alloc.c
parent6e24129cfd83899de9d6c54a8afb5a31ef98f830 (diff)
downloadgcc-7d30a7b0f70c1982a254a4e8d7f0a299dfed3520.tar.gz
* rtl.h (local_alloc): Returns an integer now.
* local-alloc.c (recorded_label_ref): New file scoped variable. (local_alloc): Initialize recorded_label_ref to zero. Return its value when local allocation has completed. (update_equiv_regs); If we create an equivalence for a LABEL_REF, set recorded_label_ref. * toplev.c (rest_of_compilation): Run the loop optimizer after register allocation and reloading if needed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@26324 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/local-alloc.c')
-rw-r--r--gcc/local-alloc.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c
index 598d405198f..d1df595c4c1 100644
--- a/gcc/local-alloc.c
+++ b/gcc/local-alloc.c
@@ -237,6 +237,9 @@ static rtx *reg_equiv_replacement;
/* Used for communication between update_equiv_regs and no_equiv. */
static rtx *reg_equiv_init_insns;
+/* Nonzero if we recorded an equivalence for a LABEL_REF. */
+static int recorded_label_ref;
+
static void alloc_qty PROTO((int, enum machine_mode, int, int));
static void validate_equiv_mem_from_store PROTO((rtx, rtx));
static int validate_equiv_mem PROTO((rtx, rtx, rtx));
@@ -292,12 +295,16 @@ alloc_qty (regno, mode, size, birth)
/* Main entry point of this file. */
-void
+int
local_alloc ()
{
register int b, i;
int max_qty;
+ /* We need to keep track of whether or not we recorded a LABEL_REF so
+ that we know if the jump optimizer needs to be rerun. */
+ recorded_label_ref = 0;
+
/* Leaf functions and non-leaf functions have different needs.
If defined, let the machine say what kind of ordering we
should use. */
@@ -410,6 +417,7 @@ local_alloc ()
free (reg_qty);
free (reg_offset);
free (reg_next_in_qty);
+ return recorded_label_ref;
}
/* Depth of loops we are in while in update_equiv_regs. */
@@ -842,6 +850,19 @@ update_equiv_regs ()
{
int regno = REGNO (dest);
+ /* Record whether or not we created a REG_EQUIV note for a LABEL_REF.
+ We might end up substituting the LABEL_REF for uses of the
+ pseudo here or later. That kind of transformation may turn an
+ indirect jump into a direct jump, in which case we must rerun the
+ jump optimizer to ensure that the JUMP_LABEL fields are valid. */
+ if (GET_CODE (XEXP (note, 0)) == LABEL_REF
+ || (GET_CODE (XEXP (note, 0)) == CONST
+ && GET_CODE (XEXP (XEXP (note, 0), 0)) == PLUS
+ && (GET_CODE (XEXP (XEXP (XEXP (note, 0), 0), 0))
+ == LABEL_REF)))
+ recorded_label_ref = 1;
+
+
reg_equiv_replacement[regno] = XEXP (note, 0);
/* Don't mess with things live during setjmp. */