This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2] S/390: Fix conditional returns on z196+


> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]