aboutsummaryrefslogtreecommitdiff
path: root/gcc/jump.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/jump.c')
-rw-r--r--gcc/jump.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/jump.c b/gcc/jump.c
index 5fef7b7..3b75110 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -2410,3 +2410,15 @@ true_regnum (x)
}
return -1;
}
+
+/* Return regno of the register REG and handle subregs too. */
+unsigned int
+reg_or_subregno (reg)
+ rtx reg;
+{
+ if (REG_P (reg))
+ return REGNO (reg);
+ if (GET_CODE (reg) == SUBREG)
+ return REGNO (SUBREG_REG (reg));
+ abort ();
+}