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

--- Comment #2 from Andreas Krebbel <krebbel at gcc dot gnu.org> ---
Author: krebbel
Date: Fri Feb  5 10:08:17 2016
New Revision: 233168

URL: https://gcc.gnu.org/viewcvs?rev=233168&root=gcc&view=rev
Log:
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  <kreb...@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.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/s390/s390.c
    trunk/gcc/config/s390/s390.md

Reply via email to