Commit 9f7ad76
committed
arc: check if the addend fits when referencing small data memory [PR115650]
This prevents linker errors when referencing small data using large
offsets. In practice it is very unlikely to be a real problem but this
was fixed because other compilers do this check and it ensures the
following tests now succeed:
- gcc.dg/torture/pr60115.c
- gcc.dg/torture/pr105665.c
PR target/115650
gcc/ChangeLog:
* config/arc/arc.cc (legitimate_small_data_address_p):
Check offset size.
gcc/testsuite/ChangeLog:
* gcc.target/arc/sdata-6.c: New test.
Signed-off-by: Michiel Derhaeg <[email protected]>1 parent b43dc7d commit 9f7ad76
2 files changed
+33
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
389 | | - | |
390 | | - | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
391 | 392 | | |
392 | 393 | | |
393 | 394 | | |
394 | 395 | | |
395 | 396 | | |
396 | | - | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
397 | 402 | | |
398 | | - | |
| 403 | + | |
399 | 404 | | |
400 | 405 | | |
401 | | - | |
| 406 | + | |
402 | 407 | | |
403 | | - | |
| 408 | + | |
404 | 409 | | |
405 | | - | |
406 | | - | |
| 410 | + | |
407 | 411 | | |
408 | 412 | | |
409 | 413 | | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
410 | 418 | | |
411 | 419 | | |
412 | 420 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
0 commit comments