From ea4210ef82eac78a2a512b48c888b88c9912c6eb Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Mon, 18 Nov 2002 14:01:23 +0000 Subject: sh-protos.h (sh_mark_label): Declare. * config/sh/sh-protos.h (sh_mark_label): Declare. * config/sh/sh.c (sh_mark_label): New function, taken from movdi_const, but fixing the case when the address has an addend. * config/sh/sh.md (movdi_const, movdi_const_32bit): Use it. From-SVN: r59217 --- gcc/config/sh/sh.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'gcc/config/sh/sh.c') diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index a26d92b..7ea35dc 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -7764,4 +7764,26 @@ sh_cannot_change_mode_class (from, to) return NO_REGS; } + +/* If ADDRESS refers to a CODE_LABEL, add NUSES to the number of times + that label is used. */ + +void +sh_mark_label (address, nuses) + rtx address; + int nuses; +{ + if (GOTOFF_P (address)) + { + /* Extract the label or symbol. */ + address = XEXP (address, 0); + if (GET_CODE (address) == PLUS) + address = XEXP (address, 0); + address = XVECEXP (address, 0, 0); + } + if (GET_CODE (address) == LABEL_REF + && GET_CODE (XEXP (address, 0)) == CODE_LABEL) + LABEL_NUSES (XEXP (address, 0)) += nuses; +} + #include "gt-sh.h" -- cgit v1.1