]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Darwin, PPC] Fix PR 65342.
authorIain Sandoe <iain@sandoe.co.uk>
Tue, 29 Oct 2019 20:20:23 +0000 (20:20 +0000)
committerIain Sandoe <iains@gcc.gnu.org>
Tue, 29 Oct 2019 20:20:23 +0000 (20:20 +0000)
commit9b6d95b967ca9dd7d9093c16c34881214af4db26
tree3778d8bf8a0edefd428958f21fcd203477a6ba0d
parent2e58cf13995d40ab6160f669cbbf28e7297f4464
[Darwin, PPC] Fix PR 65342.

The current Darwin load/store lo_sum patterns have neither predicate nor
constraint. This means that most parts of the backend, which rely on
recog() to validate the rtx, can produce invalid combinations/selections.

For 32bit cases this isn't a problem since we can load/store to unaligned
addresses using D-mode insns.

Conversely, for 64bit instructions that use DS mode, this can manifest as
assemble errors (for an assembler that checks the LO14 relocations), or as
crashes caused by wrong offsets (or worse, wrong content for the two LSBs).

What we want to check for Y on Darwin is:
  - that the alignment of the Symbols' target is sufficient for DS mode
  - that the offset is suitable for DS mode.
    (while looking through the Mach-O PIC unspecs).

So, the patch removes the Darwin-specific lo_sum patterns (we begin using
the movdi_internal64 patterns). We also we need to extend the handling of the
mem_operand_gpr constraint to allow looking through Mach-O PIC UNSPECs in
the lo_sum cases.

2019-10-29  Iain Sandoe  <iain@sandoe.co.uk>

Backport from mainline
2019-10-17  Iain Sandoe  <iain@sandoe.co.uk>

PR target/65342
* config/rs6000/darwin.md (movdi_low, movsi_low_st): Delete.
(movdi_low_st): Delete.
* config/rs6000/rs6000.c
(darwin_rs6000_legitimate_lo_sum_const_p): New.
(mem_operand_gpr): Validate Mach-O LO_SUM cases separately.
* config/rs6000/rs6000.md (movsi_low): Delete.

From-SVN: r277590
gcc/ChangeLog
gcc/config/rs6000/darwin.md
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/rs6000.md