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

Ulrich Weigand <uweigand at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |uweigand at gcc dot gnu.org

--- Comment #4 from Ulrich Weigand <uweigand at gcc dot gnu.org> ---
Yes, this seems a generic reload bug.  The comment ahead of the lines you're
adding say:

If [...] the operand contains a register that dies in this insn *and is used
nowhere else* [...]

which is supposed to be implemented by this check:

            && ! refers_to_regno_for_reload_p (regno,
                                               end_hard_regno (rel_mode,
                                                               regno),
                                               PATTERN (this_insn), inloc)

But this doesn't look into registers used as function arguments.

I'm not sure why this hasn't occured elsewhere ... however, in your particular
case, it is triggered by a call insn pattern using memory-indirect addressing,
which is probably not available on many targets.

Your patch is a little too conservative, however: it rejects any register that
could potentially be used as function argument, even if it isn't actually used
in this particular call.

Can you check whether this alternative patch (using find_reg_fusage) also fixes
the problem for you?

Reply via email to