aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/sh/sh.c
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@redhat.com>2002-11-18 14:01:23 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2002-11-18 14:01:23 +0000
commitea4210ef82eac78a2a512b48c888b88c9912c6eb (patch)
treed563874386d683a14642a7464764df24ddb0d0f5 /gcc/config/sh/sh.c
parent48f5b6723a0f7dd8e8889c2eb4deea9185863386 (diff)
downloadgcc-ea4210ef82eac78a2a512b48c888b88c9912c6eb.zip
gcc-ea4210ef82eac78a2a512b48c888b88c9912c6eb.tar.gz
gcc-ea4210ef82eac78a2a512b48c888b88c9912c6eb.tar.bz2
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
Diffstat (limited to 'gcc/config/sh/sh.c')
-rw-r--r--gcc/config/sh/sh.c22
1 files changed, 22 insertions, 0 deletions
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"