varasm: Reject soft frame or arg pointer registers for register vars [PR92469]
authorJakub Jelinek <jakub@redhat.com>
Sun, 13 Dec 2020 16:08:08 +0000 (17:08 +0100)
committerJakub Jelinek <jakub@redhat.com>
Sun, 13 Dec 2020 16:08:08 +0000 (17:08 +0100)
commitd88e2cb54914cf8aa0ae68ca75dc45237acfcef0
tree4bf7aac7518e05f8e01249158089a9b4b5b30a52
parent3b8a82f97dd48e153ce93b317c44254839e11461
varasm: Reject soft frame or arg pointer registers for register vars [PR92469]

The following patch rejects frame, argp and retarg registers (unless they are equal
to hard frame pointer registers or if they aren't eliminable) from local or global
register vars.
These are just internal implementation details eliminated later into hard
frame pointer or stack pointer and using them as register variable leads
to numerous ICEs.

2020-12-13  Jakub Jelinek  <jakub@redhat.com>

PR target/92469
* varasm.c (eliminable_regno_p): New function.
(make_decl_rtl): Reject asm vars for frame and argp
if they are different from hard frame pointer.

* gcc.target/i386/pr92469.c: New test.
* gcc.target/i386/pr79804.c: Adjust expected diagnostics.
* gcc.target/i386/pr88178.c: Expect an error.
gcc/testsuite/gcc.target/i386/pr79804.c
gcc/testsuite/gcc.target/i386/pr88178.c
gcc/testsuite/gcc.target/i386/pr92469.c [new file with mode: 0644]
gcc/varasm.c