]> git.ipfire.org Git - thirdparty/gcc.git/commit
IBM Z: Fix PR96308
authorAndreas Krebbel <krebbel@linux.ibm.com>
Wed, 12 Aug 2020 06:02:35 +0000 (08:02 +0200)
committerGiuliano Belinassi <giuliano.belinassi@usp.br>
Mon, 17 Aug 2020 18:08:02 +0000 (15:08 -0300)
commit55412ec647ecb6cf3575c665651b2359cca7f269
tree75ec0b7563aad5ad025c7a7b58c55dcfd9038095
parentc73a6f5af0dbf880f017dcec386d0e6240f29f95
IBM Z: Fix PR96308

For the testcase a symbol with a TLS reloc and an unary minus is being
generated.  The backend didn't handle this correctly.

In s390_cannot_force_const_mem an unary minus on a symbolic constant
is rejected now since gas would not allow this.

legitimize_tls_address now makes the NEG rtx the outermost operation
by pulling it out of the CONST rtx.

gcc/ChangeLog:

PR target/96308
* config/s390/s390.c (s390_cannot_force_const_mem): Reject an
unary minus for everything not being a numeric constant.
(legitimize_tls_address): Move a NEG out of the CONST rtx.

gcc/testsuite/ChangeLog:

PR target/96308
* g++.dg/pr96308.C: New test.
gcc/config/s390/s390.c
gcc/testsuite/g++.dg/pr96308.C [new file with mode: 0644]