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: Ilya Leoshkevich <iii at linux dot ibm dot com>
- To: Ulrich Weigand <uweigand at de dot ibm dot com>
- 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
- Date: Fri, 21 Sep 2018 13:10:09 +0200
- Subject: Re: [PATCH v2] S/390: Fix conditional returns on z196+
- References: <20180921105040.4DC6CD80332@oc3748833570.ibm.com>
> Am 21.09.2018 um 12:50 schrieb Ulrich Weigand <uweigand@de.ibm.com>:
>
> 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?
My reasoning was that even though right now gen_return_use is called
only from one place, if we ever add a second one, then we would most
likely have to duplicate the return_reg check.
>
>> +++ 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.)
>
Thanks, I didn’t know that. I’ll add REG_P here.