aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/or1k/constraints.md
diff options
context:
space:
mode:
authorStafford Horne <shorne@gmail.com>2019-08-31 06:00:56 +0000
committerStafford Horne <shorne@gcc.gnu.org>2019-08-31 06:00:56 +0000
commitfd631eb5a7597a7040f770b2a912cec13af50df4 (patch)
tree29306617e9d66d1e5b92c3832c3ab9d2e5d7a0f0 /gcc/config/or1k/constraints.md
parent3ba155dd1921b55f04866b35a2e054e092670cd6 (diff)
downloadgcc-fd631eb5a7597a7040f770b2a912cec13af50df4.zip
gcc-fd631eb5a7597a7040f770b2a912cec13af50df4.tar.gz
gcc-fd631eb5a7597a7040f770b2a912cec13af50df4.tar.bz2
or1k: Fix issue with set_got clobbering LR (r9)
When compiling glibc we found that the GOT register was being allocated r9 when the instruction was still set_got_tmp. That is a problem because r9 is the Link Register (LR) in OpenRISC which is used/clobbered in set_got. We cannot use r9 as the GOT register. Also, we cannot simply say set_got_tmp clobbers r9 as this is the reason for having the temporary set_got_tmp. Fix by using a register class constraint that does not allow r9 during register allocation. gcc/ChangeLog: * config/or1k/constraints.md (t): New constraint. * config/or1k/or1k.h (GOT_REGS): New register class. * config/or1k/or1k.md (set_got_tmp, set_got): Use t contraint. From-SVN: r275242
Diffstat (limited to 'gcc/config/or1k/constraints.md')
-rw-r--r--gcc/config/or1k/constraints.md4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/config/or1k/constraints.md b/gcc/config/or1k/constraints.md
index 8cac7eb..3ca477c 100644
--- a/gcc/config/or1k/constraints.md
+++ b/gcc/config/or1k/constraints.md
@@ -25,6 +25,7 @@
; We use:
; c - sibcall registers
; d - double pair base registers (excludes r0, r30 and r31 which overflow)
+; t - got address registers (excludes LR (r9) which is clobbered by set_got)
; I - constant signed 16-bit
; K - constant unsigned 16-bit
; M - constant signed 16-bit shifted left 16-bits (l.movhi)
@@ -36,6 +37,9 @@
(define_register_constraint "d" "DOUBLE_REGS"
"Registers which can be used for double reg pairs.")
+(define_register_constraint "t" "GOT_REGS"
+ "Registers which can be used to store the Global Offset Table (GOT) address.")
+
;; Immediates
(define_constraint "I"
"A signed 16-bit immediate in the range -32768 to 32767."