https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89233

--- Comment #3 from iii at gcc dot gnu.org ---
Author: iii
Date: Tue Feb 12 14:51:39 2019
New Revision: 268798

URL: https://gcc.gnu.org/viewcvs?rev=268798&root=gcc&view=rev
Log:
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  <i...@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  <i...@linux.ibm.com>

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

Added:
    trunk/gcc/testsuite/gcc.target/s390/pr89233.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/s390/s390.c
    trunk/gcc/testsuite/ChangeLog

Reply via email to