aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1993-03-30 15:36:43 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1993-03-30 15:36:43 -0500
commit99309f3bcbb8cd7d7504a89b32588d301609bf9e (patch)
treeb39e317a5a9ab4ccd349302a9169191489e86df3
parent2c0623e83abf78609905752326e68fc5b6724ffd (diff)
downloadgcc-99309f3bcbb8cd7d7504a89b32588d301609bf9e.zip
gcc-99309f3bcbb8cd7d7504a89b32588d301609bf9e.tar.gz
gcc-99309f3bcbb8cd7d7504a89b32588d301609bf9e.tar.bz2
(find_regno_note): Find note that overlaps REGNO, not just one that
mentions REGNO explicitly. From-SVN: r3929
-rw-r--r--gcc/rtlanal.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 658f57f..549f905 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -1135,7 +1135,9 @@ find_reg_note (insn, kind, datum)
}
/* Return the reg-note of kind KIND in insn INSN which applies to register
- number REGNO, if any. Return 0 if there is no such reg-note. */
+ number REGNO, if any. Return 0 if there is no such reg-note. Note that
+ the REGNO of this NOTE need not be REGNO if REGNO is a hard register;
+ it might be the case that the note overlaps REGNO. */
rtx
find_regno_note (insn, kind, regno)
@@ -1150,7 +1152,12 @@ find_regno_note (insn, kind, regno)
/* Verify that it is a register, so that scratch and MEM won't cause a
problem here. */
&& GET_CODE (XEXP (link, 0)) == REG
- && REGNO (XEXP (link, 0)) == regno)
+ && REGNO (XEXP (link, 0)) <= regno
+ && ((REGNO (XEXP (link, 0))
+ + (REGNO (XEXP (link, 0)) >= FIRST_PSEUDO_REGISTER ? 1
+ : HARD_REGNO_NREGS (REGNO (XEXP (link, 0)),
+ GET_MODE (XEXP (link, 0)))))
+ > regno))
return link;
return 0;
}