From 89d3d4424947aa2328d79659144f3bbad6998255 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Mon, 22 Feb 1999 14:11:58 +0000 Subject: [PATCH] loop.c (libcall_other_regs): Make extern. * loop.c (libcall_other_regs): Make extern. * rtl.h (find_last_value): Add parameter to prototype. (libcall_other_reg): Add extern declaration. * rtlanal.c (find_last_value): Add another parameter to allow a definition using a hardware register to be found as well. From-SVN: r25378 --- gcc/ChangeLog | 8 ++++++++ gcc/loop.c | 3 +-- gcc/rtl.h | 3 ++- gcc/rtlanal.c | 10 ++++++---- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 321077fb4cb..ab0a16bfa9f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +Mon Feb 22 16:54:18 EST 1999 Andrew MacLeod + + * loop.c (libcall_other_regs): Make extern. + * rtl.h (find_last_value): Add parameter to prototype. + (libcall_other_reg): Add extern declaration. + * rtlanal.c (find_last_value): Add another parameter to allow + a definition using a hardware register to be found as well. + Mon Feb 22 13:33:47 1999 Mark Mitchell * cse.c (dump_class): New function. diff --git a/gcc/loop.c b/gcc/loop.c index 962736f9f6a..cd77cddee5c 100644 --- a/gcc/loop.c +++ b/gcc/loop.c @@ -291,7 +291,6 @@ static void mark_loop_jump PROTO((rtx, int)); static void prescan_loop PROTO((rtx, rtx)); static int reg_in_basic_block_p PROTO((rtx, rtx)); static int consec_sets_invariant_p PROTO((rtx, int, rtx)); -static rtx libcall_other_reg PROTO((rtx, rtx)); static int labels_in_range_p PROTO((rtx, int)); static void count_one_set PROTO((rtx, rtx, varray_type, rtx *)); @@ -1241,7 +1240,7 @@ record_excess_regs (in_this, not_in_this, output) If there are none, return 0. If there are one or more, return an EXPR_LIST containing all of them. */ -static rtx +rtx libcall_other_reg (insn, equiv) rtx insn, equiv; { diff --git a/gcc/rtl.h b/gcc/rtl.h index f036a6fe917..2839c883502 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -1013,7 +1013,7 @@ extern int modified_in_p PROTO((rtx, rtx)); extern int reg_set_p PROTO((rtx, rtx)); extern rtx single_set PROTO((rtx)); extern int multiple_sets PROTO((rtx)); -extern rtx find_last_value PROTO((rtx, rtx *, rtx)); +extern rtx find_last_value PROTO((rtx, rtx *, rtx, int)); extern int refers_to_regno_p PROTO((int, int, rtx, rtx *)); extern int reg_overlap_mentioned_p PROTO((rtx, rtx)); extern void note_stores PROTO((rtx, void (*)())); @@ -1390,6 +1390,7 @@ extern void print_inline_rtx PROTO ((FILE *, rtx, int)); /* In loop.c */ extern void init_loop PROTO ((void)); +extern rtx libcall_other_reg PROTO ((rtx, rtx)); #ifdef BUFSIZ extern void loop_optimize PROTO ((rtx, FILE *, int, int)); #endif diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index 41744d747a2..1dabc369c18 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -740,13 +740,15 @@ multiple_sets (insn) /* Return the last thing that X was assigned from before *PINSN. Verify that the object is not modified up to VALID_TO. If it was, if we hit a partial assignment to X, or hit a CODE_LABEL first, return X. If we - found an assignment, update *PINSN to point to it. */ + found an assignment, update *PINSN to point to it. + ALLOW_HWREG is set to 1 if hardware registers are allowed to be the src. */ rtx -find_last_value (x, pinsn, valid_to) +find_last_value (x, pinsn, valid_to, allow_hwreg) rtx x; rtx *pinsn; rtx valid_to; + int allow_hwreg; { rtx p; @@ -767,8 +769,8 @@ find_last_value (x, pinsn, valid_to) if (! modified_between_p (src, PREV_INSN (p), valid_to) /* Reject hard registers because we don't usually want to use them; we'd rather use a pseudo. */ - && ! (GET_CODE (src) == REG - && REGNO (src) < FIRST_PSEUDO_REGISTER)) + && (! (GET_CODE (src) == REG + && REGNO (src) < FIRST_PSEUDO_REGISTER) || allow_hwreg)) { *pinsn = p; return src;