diff options
author | Ilya Leoshkevich <iii@linux.ibm.com> | 2018-10-24 12:04:53 +0000 |
---|---|---|
committer | Ilya Leoshkevich <iii@gcc.gnu.org> | 2018-10-24 12:04:53 +0000 |
commit | 6f7133ec4f4b34aca38c286bb3d95c311206d1c6 (patch) | |
tree | 4a9a2fdc02deda673a66e0b5eb44a41d45798fc8 | |
parent | be43a8877e2f2f4590ba667b27a24a0cfdf8141d (diff) | |
download | gcc-6f7133ec4f4b34aca38c286bb3d95c311206d1c6.zip gcc-6f7133ec4f4b34aca38c286bb3d95c311206d1c6.tar.gz gcc-6f7133ec4f4b34aca38c286bb3d95c311206d1c6.tar.bz2 |
S/390: Fix ICE in s390_check_qrst_address ()
In r265371 (S/390: Make "b" constraint match literal pool references)
the CONSTANT_POOL_ADDRESS_P () check was moved from
s390_loadrelative_operand_p () to s390_check_qrst_address (). However,
in the original code it was guarded by SYMBOL_REF_P (), which was not
added to the new code.
gcc/ChangeLog:
2018-10-24 Ilya Leoshkevich <iii@linux.ibm.com>
* config/s390/s390.c (s390_check_qrst_address): Add the missing
SYMBOL_REF_P () check.
gcc/testsuite/ChangeLog:
2018-10-24 Ilya Leoshkevich <iii@linux.ibm.com>
* gcc.target/s390/20181024-1.c: New test.
From-SVN: r265458
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/s390/s390.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/s390/20181024-1.c | 32 |
4 files changed, 44 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bd70bab..300ab6c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-10-24 Ilya Leoshkevich <iii@linux.ibm.com> + + * config/s390/s390.c (s390_check_qrst_address): Add the missing + SYMBOL_REF_P () check. + 2018-10-24 Richard Biener <rguenther@suse.de> PR tree-optimization/87105 diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 1de1a71..ae28a36 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -3162,7 +3162,9 @@ s390_check_qrst_address (char c, rtx op, bool lit_pool_ok) /* This check makes sure that no symbolic address (except literal pool references) are accepted by the R or T constraints. */ if (s390_loadrelative_operand_p (op, &symref, NULL) - && (!lit_pool_ok || !CONSTANT_POOL_ADDRESS_P (symref))) + && (!lit_pool_ok + || !SYMBOL_REF_P (symref) + || !CONSTANT_POOL_ADDRESS_P (symref))) return 0; /* Ensure literal pool references are only accepted if LIT_POOL_OK. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index df476ec2..3a9e5af 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2018-10-24 Ilya Leoshkevich <iii@linux.ibm.com> + + * gcc.target/s390/20181024-1.c: New test. + 2018-10-24 Richard Biener <rguenther@suse.de> PR tree-optimization/87105 diff --git a/gcc/testsuite/gcc.target/s390/20181024-1.c b/gcc/testsuite/gcc.target/s390/20181024-1.c new file mode 100644 index 0000000..830ab5b --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/20181024-1.c @@ -0,0 +1,32 @@ +/* Make sure s390_check_qrst_address () correctly handles UNSPEC rtxs. */ +/* { dg-compile } */ +/* { dg-options "-march=z196 -O2 -fPIC" } */ + +int a, b, g, h; +struct +{ + int i; + struct + { + int d; + } k[]; +} f; + +void m(int); + +void l() +{ + int j; + for (; h;) + { + m(( + { + __asm__("" : "=r"(g)); + b; + } + )); + f.k[j].d = a; + j++; + } + f.i = j; +} |