On 08/25/14 16:42, Easwaran Raman wrote:
This patch deletes REG_EQUAL note when a src register is replaced by a
constant in an assignment. This is to prevent spurious equivalences
between the constant and the expression in the REG_EQUAL note. In the
bug reported in PR 62146, an assignment in one branch (which is
actually dead) of an IF statement has a REG_EQUAL note equating a
register with an expression. Conditional copy propagation replaces the
register with 0. The instruction is hoisted above the branch
subsequently and then the value 0 is equated with the expression in
the REG_EQUAL. Is this ok for 4.9 branch if all tests pass?

This patch looks applicable to trunk as well, but I don't have a test
case to reproduce the issue in trunk.
Something doesn't feel right with this patch. It seems to me the real problem is when when hoist the insn with the note. If the equivalence implied by the note is no longer valid at the insn's new location, then the note needs to be removed.

Now determining if the note is no longer valid at the new location may prove difficult ;-) You'd probably have to know why the note was created, how it was changed, etc. So I suspect the right thing to do is just remove REG_EQUAL notes on any insns we hoist in this manner.

Jeff

Reply via email to