aboutsummaryrefslogtreecommitdiff
path: root/gcc/local-alloc.c
diff options
context:
space:
mode:
authorJeffrey A Law <law@cygnus.com>1999-04-10 02:55:36 +0000
committerJeff Law <law@gcc.gnu.org>1999-04-09 20:55:36 -0600
commit3f1b9b1b90632ed16bcc15a27547482be6020dfb (patch)
tree224a58188d16a5c87219ebe17fc74ad7dc836b76 /gcc/local-alloc.c
parentd1c13bdab5e3a7bcb037ae9e3c73e0d6ff0a180f (diff)
downloadgcc-3f1b9b1b90632ed16bcc15a27547482be6020dfb.zip
gcc-3f1b9b1b90632ed16bcc15a27547482be6020dfb.tar.gz
gcc-3f1b9b1b90632ed16bcc15a27547482be6020dfb.tar.bz2
rtl.h (local_alloc): Returns an integer now.
* 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. From-SVN: r26324
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 598d405..d1df595 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. */