This is the mail archive of the gcc-bugs@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]

[Bug rtl-optimization/80352] Improper reload of operands with equiv pseudo


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

--- Comment #4 from Thomas Preud'homme <thopre01 at gcc dot gnu.org> ---
(In reply to Vladimir Makarov from comment #1)
> Thomas, it seems from your description the problem really exists.  I tried
> to reproduce the problem with the test you provided but I've failed.  I used
> today trunk.
> 
> Could you provide more info (may be -mcpu/-march etc) or/and another test.

Hi Vladimir,

My phrasing is incorrect, the testcase I provided does not allow to reproduce
the issue but allows to reproduce the conditions necessary for the issue. To
actually run into the problem of reload loop you need to undo a couple of
changes done to LRA recently that hide this problem. Specifically, you need to
undo;

* the changes made by r237277 and r238010 relating to the reject += 3
* the changes made by r246808 and r246854 relating to the other reject += 3
below the one mentioned above (note: this one seems redundant)

Put a breakpoint on the badop = false in the CT_MEMORY case with the condition
that the if is true because of equiv_substitution_p (ie the rest of the
expression is false). Then the testcase with the modifications will make
alternative 5 (memory) to be chosen and you'll see what happens in
curr_insn_transform after the call to get_reload_reg. process_alt_operands will
be called again and the reg alternative will fail to match for the register
created by get_reload_reg because it was NO_REG and the same will happen again
1-2 other time.

Note that without the modification above the memory alternative will have lower
cost and thus is not chosen, which prevent the bug to occur.

Best regards.

                      if (CONST_POOL_OK_P (mode, op)
                          || MEM_P (op) || REG_P (op)
                          /* We can restore the equiv insn by a
                             reload.  */
                          || equiv_substition_p[nop])
                        badop = false;

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