S/390: PR91035 Fix call to __morestack
commit051fb43f810d34a683a5112112757abf6998325a
authorAndreas Krebbel <krebbel@linux.ibm.com>
Thu, 10 Oct 2019 07:56:25 +0000 (10 07:56 +0000)
committerAndreas Krebbel <krebbel@gcc.gnu.org>
Thu, 10 Oct 2019 07:56:25 +0000 (10 07:56 +0000)
tree67401d8660db22285557b39316ba639049103b13
parent94e7f906ca5c73fb79d21ec54733e9e75a96c2b4
S/390: PR91035 Fix call to __morestack

For the call to __morestack we use a special ABI in the S/390 back-end
which requires us to emit a parameter block to the .rodata section.
It contains the label whereto __morestack needs to return.  The
parameter block needs to be explicit in RTL since we also need to take
the address of it loaded into r1 in order to pass its address to
__morestack.  In order to express correctly what __morestack does its
RTX also contained the return label. Hence we had the return label to
occur twice in the insn stream.  This is problematic when it comes to
redirecting edges.  The correlation between these two occurrences of
the label cannot be expressed so when doing a redirect only the label
in the jump RTX gets modified while the parameter block label stays as
is.

The patch avoids having two instancs of the label by merging the
parameter block generation and the __morestack call RTX into one. By
doing this I could also get rid of the unspec which was required for
the parameter block generation so far.

gcc/ChangeLog:

2019-10-10  Andreas Krebbel  <krebbel@linux.ibm.com>

PR target/91035
* config/s390/s390-protos.h (s390_output_split_stack_data): Add
prototype.
* config/s390/s390.md (UNSPECV_SPLIT_STACK_DATA): Remove.
("split_stack_data", "split_stack_call")
("split_stack_call_<mode>", "split_stack_cond_call")
("split_stack_cond_call_<mode>"): Remove.
("@split_stack_call<mode>", "@split_stack_cond_call<mode>"): New
insn definition.
* config/s390/s390.c (s390_output_split_stack_data): New function.
(s390_expand_split_stack_prologue): Use the merged expander.

From-SVN: r276790
gcc/ChangeLog
gcc/config/s390/s390-protos.h
gcc/config/s390/s390.c
gcc/config/s390/s390.md