Commit 340ba45
MIPS: fix emitDirectiveCpsetup on N32 (llvm#80534)
In gas, .cpsetup may expand to one of two code sequences (one is related to `__gnu_local_gp`), depending on -mno-shared and -msym32.
Since Clang doesn't support -mno-shared or -msym32, .cpsetup expands to one code sequence.
The N32 condition incorrectly leads to the incorrect `__gnu_local_gp` code sequence.
```
00000000 <t1>:
0: ffbc0008 sd gp,8(sp)
4: 3c1c0000 lui gp,0x0
4: R_MIPS_HI16 __gnu_local_gp
8: 279c0000 addiu gp,gp,0
8: R_MIPS_LO16 __gnu_local_gp
```
Fixes: llvm#52785
(cherry picked from commit 860b6ed)1 parent 439e6f8 commit 340ba45
File tree
2 files changed
+44
-15
lines changed- llvm
- lib/Target/Mips/MCTargetDesc
- test/MC/Mips
2 files changed
+44
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1255 | 1255 | | |
1256 | 1256 | | |
1257 | 1257 | | |
1258 | | - | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
1259 | 1261 | | |
1260 | 1262 | | |
1261 | 1263 | | |
| |||
1273 | 1275 | | |
1274 | 1276 | | |
1275 | 1277 | | |
| 1278 | + | |
1276 | 1279 | | |
1277 | 1280 | | |
1278 | 1281 | | |
| |||
1288 | 1291 | | |
1289 | 1292 | | |
1290 | 1293 | | |
1291 | | - | |
1292 | | - | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
1293 | 1299 | | |
1294 | 1300 | | |
1295 | 1301 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | 7 | | |
10 | 8 | | |
11 | 9 | | |
| |||
35 | 33 | | |
36 | 34 | | |
37 | 35 | | |
38 | | - | |
39 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
40 | 40 | | |
41 | | - | |
42 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
| |||
64 | 67 | | |
65 | 68 | | |
66 | 69 | | |
67 | | - | |
68 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
69 | 74 | | |
70 | | - | |
71 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
72 | 80 | | |
73 | 81 | | |
74 | 82 | | |
| |||
101 | 109 | | |
102 | 110 | | |
103 | 111 | | |
104 | | - | |
105 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
106 | 116 | | |
107 | | - | |
108 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
109 | 122 | | |
110 | 123 | | |
111 | 124 | | |
| |||
158 | 171 | | |
159 | 172 | | |
160 | 173 | | |
161 | | - | |
162 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
163 | 178 | | |
164 | | - | |
165 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
166 | 184 | | |
167 | 185 | | |
168 | 186 | | |
| |||
184 | 202 | | |
185 | 203 | | |
186 | 204 | | |
187 | | - | |
188 | 205 | | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
189 | 209 | | |
190 | | - | |
191 | 210 | | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
192 | 215 | | |
193 | 216 | | |
194 | 217 | | |
| |||
0 commit comments