]> git.ipfire.org Git - thirdparty/gcc.git/commit
S/390: Reject invalid Q/R/S/T addresses after LRA
authoriii <iii@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 12 Feb 2019 14:51:39 +0000 (14:51 +0000)
committeriii <iii@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 12 Feb 2019 14:51:39 +0000 (14:51 +0000)
commit7bd6e7543f2d7f89805677645ca74bcbf452372a
tree8a07a2f8f1f075a0d1e889ad7605018d576d6f9e
parentf523999089fe14ffae420555701dfd804e48ad60
S/390: Reject invalid Q/R/S/T addresses after LRA

The following insn:

(insn (set (reg:DI %r2)
           (sign_extend:DI (mem:SI
            (const:DI (plus:DI (symbol_ref:DI ("*.LC0"))
                               (const_int 16)))))))

is correctly recognized by LRA as RIL alternative of extendsidi2
define_insn.  However, when recognition runs after LRA, it returns RXY
alternative, which is incorrect, since the offset 16 points past the
end of of *.LC0 literal pool entry.  Such addresses are normally
rejected by s390_decompose_address ().

This inconsistency confuses annotate_constant_pool_refs: the selected
alternative makes it proceed with annotation, only to find that the
annotated address is invalid, causing ICE.

This patch fixes the root cause, namely, that s390_check_qrst_address ()
behaves differently during and after LRA.

gcc/ChangeLog:

2019-02-12  Ilya Leoshkevich  <iii@linux.ibm.com>

PR target/89233
* config/s390/s390.c (s390_decompose_address): Update comment.
(s390_check_qrst_address): Reject invalid address forms after
LRA.

gcc/testsuite/ChangeLog:

2019-02-12  Ilya Leoshkevich  <iii@linux.ibm.com>

PR target/89233
* gcc.target/s390/pr89233.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@268798 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/config/s390/s390.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/s390/pr89233.c [new file with mode: 0644]