Ilya Leoshkevich wrote:

> 2018-09-19  Ilya Leoshkevich  <i...@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.weig...@de.ibm.com

Reply via email to