S/390: Fix r6 vararg handling.
authorAndreas Krebbel <krebbel@linux.vnet.ibm.com>
Fri, 5 Feb 2016 10:08:17 +0000 (10:08 +0000)
committerAndreas Krebbel <krebbel@gcc.gnu.org>
Fri, 5 Feb 2016 10:08:17 +0000 (10:08 +0000)
commit82379bdf028762c0eafece56bd69a687d991765b
tree9291a93ed65dac84d6043d81213cfd6782ed08f8
parent5421e2cab2e132f51d227a4c643eee4e764d7969
S/390: Fix r6 vararg handling.

This patch fixes a problem introduced with the GPR into FPR slot save
feature for leaf functions.

r6 is argument register as well as call-saved.  Currently we might
decide that it will be a candidate for being saved into an FPR.  If it
turns out later that r6 also needs to be saved due to being required
for vararg we undo the FPR save decision and put it on the stack
again.  Unfortunately the code did not adjust the GPR restore range
accordingly so that the register does not get restored in the load
multiple.

This fixes the following testcases on s390x:

< FAIL: libgomp.c/doacross-1.c execution test
< FAIL: libgomp.c/doacross-2.c execution test
< FAIL: libgomp.c/doacross-3.c execution test
< FAIL: libgomp.c++/doacross-1.C execution test

gcc/ChangeLog:

2016-02-05  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

    PR target/69625
    * config/s390/s390.c (SAVE_SLOT_NONE, SAVE_SLOT_STACK): New
    defines.
    (s390_register_info_gprtofpr): Use new macros above.
    (s390_register_info_stdarg_fpr): Adjust max_fpr to better match
    its name.
    (s390_register_info_stdarg_gpr): Adjust max_gpr to better match
    its name.  Adjust restore and save gpr ranges.
    (s390_register_info_set_ranges): New function.
    (s390_register_info): Use new macros above.  Call
    s390_register_info_set_ranges.
    (s390_optimize_register_info): Likewise.
    (s390_hard_regno_rename_ok): Use new macros.
    (s390_hard_regno_scratch_ok): Likewise.
    (s390_emit_epilogue): Likewise.
    (s390_can_use_return_insn): Likewise.
    (s390_optimize_prologue): Likewise.
    * config/s390/s390.md (GPR2_REGNUM, GPR6_REGNUM): New constants.

From-SVN: r233168
gcc/ChangeLog
gcc/config/s390/s390.c
gcc/config/s390/s390.md