summaryrefslogtreecommitdiff
path: root/toolchain/gcc/patches/9.4.0/or1k.patch
blob: 8ec5ec956b348bc87ef8416e234093ed4d24dce8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
diff -Nur gcc-9.2.0.orig/gcc/config/or1k/constraints.md gcc-9.2.0/gcc/config/or1k/constraints.md
--- gcc-9.2.0.orig/gcc/config/or1k/constraints.md	2019-01-01 13:31:55.000000000 +0100
+++ gcc-9.2.0/gcc/config/or1k/constraints.md	2019-10-07 10:59:48.995389485 +0200
@@ -32,6 +32,9 @@
 (define_register_constraint "c" "SIBCALL_REGS"
   "Registers which can hold a sibling call address")
 
+(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."
diff -Nur gcc-9.2.0.orig/gcc/config/or1k/or1k.h gcc-9.2.0/gcc/config/or1k/or1k.h
--- gcc-9.2.0.orig/gcc/config/or1k/or1k.h	2019-01-01 13:31:55.000000000 +0100
+++ gcc-9.2.0/gcc/config/or1k/or1k.h	2019-10-07 12:14:41.334692831 +0200
@@ -189,6 +189,7 @@
 {
   NO_REGS,
   SIBCALL_REGS,
+  GOT_REGS,
   GENERAL_REGS,
   FLAG_REGS,
   ALL_REGS,
@@ -200,6 +201,7 @@
 #define REG_CLASS_NAMES {	\
   "NO_REGS", 			\
   "SIBCALL_REGS",		\
+  "GOT_REGS",			\
   "GENERAL_REGS",		\
   "FLAG_REGS",			\
   "ALL_REGS" }
@@ -212,6 +214,7 @@
 #define REG_CLASS_CONTENTS      \
 { { 0x00000000, 0x00000000 },	\
   { SIBCALL_REGS_MASK,   0 },	\
+  { 0xfffffdff, 0x00000000 },	\
   { 0xffffffff, 0x00000003 },	\
   { 0x00000000, 0x00000004 },	\
   { 0xffffffff, 0x00000007 }	\
diff -Nur gcc-9.2.0.orig/gcc/config/or1k/or1k.md gcc-9.2.0/gcc/config/or1k/or1k.md
--- gcc-9.2.0.orig/gcc/config/or1k/or1k.md	2019-01-01 13:31:55.000000000 +0100
+++ gcc-9.2.0/gcc/config/or1k/or1k.md	2019-10-07 10:59:48.999389485 +0200
@@ -595,7 +595,7 @@
 ;; set_got pattern below.  This works because the set_got_tmp insn is the
 ;; first insn in the stream and that it isn't moved during RA.
 (define_insn "set_got_tmp"
-  [(set (match_operand:SI 0 "register_operand" "=r")
+  [(set (match_operand:SI 0 "register_operand" "=t")
 	(unspec_volatile:SI [(const_int 0)] UNSPECV_SET_GOT))]
   ""
 {
@@ -604,7 +604,7 @@
 
 ;; The insn to initialize the GOT.
 (define_insn "set_got"
-  [(set (match_operand:SI 0 "register_operand" "=r")
+  [(set (match_operand:SI 0 "register_operand" "=t")
 	(unspec:SI [(const_int 0)] UNSPEC_SET_GOT))
    (clobber (reg:SI LR_REGNUM))]
   ""