This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH v2] S/390: Fix conditional returns on z196+
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: iii at linux dot ibm dot com (Ilya Leoshkevich)
- Cc: gcc-patches at gcc dot gnu dot org, krebbel at linux dot ibm dot com, rdapp at linux dot ibm dot com, segher at kernel dot crashing dot org, iii at linux dot ibm dot com (Ilya Leoshkevich)
- Date: Fri, 21 Sep 2018 12:50:40 +0200 (CEST)
- Subject: Re: [PATCH v2] S/390: Fix conditional returns on z196+
Ilya Leoshkevich wrote:
> 2018-09-19 Ilya Leoshkevich <iii@linux.ibm.com>
>
> PR target/80080
> * config/s390/s390.md: Do not use PARALLEL RETURN+USE when
> returning via %r14.
This makes sense to me. I'm just wondering if it wouldn't be
simpler to do the check for r14 right in s390_emit_epilogue
and then just call gen_return instead of gen_return_use
directly there?
> +++ b/gcc/config/s390/s390.md
> @@ -10831,6 +10831,13 @@
> (use (match_operand 0 "register_operand" "a"))])]
> ""
> {
> + if (REGNO (operands[0]) == RETURN_REGNUM && s390_can_use_return_insn ())
This probably cannot happen in practice in this specific case,
but in general a register_operand may also be e.g. a SUBREG,
so you shouldn't use REGNO without first verifying that this
is a REG. (If you move the check to s390_emit_epilogue as above,
this point is moot; you don't even need to generate a REG RTX
if it's for r14 then.)
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU/Linux compilers and toolchain
Ulrich.Weigand@de.ibm.com