Richard, thank you for working on this issue and for as usually detailed explanation of the problem.

On 2020-08-28 9:52 a.m., Richard Sandiford wrote:
...

The patch is quite aggressive in that it does this for all reload
pseudos in all reload instructions.  I wondered about reusing the
condition for a reload move in in_class_p:

           INSN_UID (curr_insn) >= new_insn_uid_start
           && curr_insn_set != NULL
           && ((OBJECT_P (SET_SRC (curr_insn_set))
                && ! CONSTANT_P (SET_SRC (curr_insn_set)))
               || (GET_CODE (SET_SRC (curr_insn_set)) == SUBREG
                   && OBJECT_P (SUBREG_REG (SET_SRC (curr_insn_set)))
                   && ! CONSTANT_P (SUBREG_REG (SET_SRC (curr_insn_set)))))))

but I can't really justify that on first principles.  I think we
should apply the rule consistently until we have a specific reason
for doing otherwise.
I can not predict how the patch will behave and I can not say either that less aggressive patch is better.  So let us try.

OK for trunk?
Yes, thank you again.
   If so, I think we should leave it on trunk for a bit
before backporting.

...

It seems reasonable.

I'm off next week, so if the patch is OK, I'll hold off applying
until I get back.

Richard


gcc/
        PR rtl-optimization/96796
        * lra-constraints.c (in_class_p): Add a default-false
        allow_all_reload_class_changes_p parameter.  Do not treat
        reload moves specially when the parameter is true.
        (get_reload_reg): Try to narrow the class of an existing OP_OUT
        reload if we're reloading a reload pseudo in a reload instruction.

gcc/testsuite/
        PR rtl-optimization/96796
        * gcc.c-torture/compile/pr96796.c: New test.

Reply via email to