summaryrefslogtreecommitdiffstats
path: root/gcc/config/sh/sh.c
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2002-11-18 14:01:23 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2002-11-18 14:01:23 +0000
commit33946087275c4f4a450fb54fbee97d02bdd80cd3 (patch)
treed563874386d683a14642a7464764df24ddb0d0f5 /gcc/config/sh/sh.c
parent8e9833f3d57b2e209870aef68ae6b17b39a114a8 (diff)
downloadppe42-gcc-33946087275c4f4a450fb54fbee97d02bdd80cd3.tar.gz
ppe42-gcc-33946087275c4f4a450fb54fbee97d02bdd80cd3.zip
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59217 138bc75d-0d04-0410-961f-82ee72b054a4
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 a26d92b8339..7ea35dc5261 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"
OpenPOWER on IntegriCloud