S/390: PR79904: Disallow reg + sym_ref literal pool addresses.
authorAndreas Krebbel <krebbel@linux.vnet.ibm.com>
Fri, 24 Mar 2017 13:52:30 +0000 (13:52 +0000)
committerAndreas Krebbel <krebbel@gcc.gnu.org>
Fri, 24 Mar 2017 13:52:30 +0000 (13:52 +0000)
commit085db63d5899052fa0cf8c09e51b9ebaf5c5fb0c
treeb131b32e8a988e3abb690c01244ae7791152812e
parentdc4f29bc9a9dfcc68b20c0ce767cc3d6fb7409d4
S/390: PR79904: Disallow reg + sym_ref literal pool addresses.

We accept reg + sym_ref as valid address if sym_ref is a literal pool
reference knowing that it will be rewritten as r13 + reg + offset.
However, annotate_constant_pool_refs was never able to handle that.

With the patch only single sym_refs are accepted.

Regression tested on s390x.

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

PR target/79904
* config/s390/s390.c (s390_decompose_address): Reject reg +
sym_ref literal pool references.

gcc/testsuite/ChangeLog:

2017-03-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

* gcc.dg/ubsan/pr79904-2.c: New test.

From-SVN: r246443
gcc/config/s390/s390.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/ubsan/pr79904-2.c [new file with mode: 0644]