On Mon, Aug 25, 2014 at 3:42 PM, Easwaran Raman <era...@google.com> 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.
>
>
> ChangeLog:
>
> 2014-08-25  Easwaran Raman  <era...@google.com>
>
>         PR rtl-optimization/62146
>         * cprop.c (try_replace_reg): Remove REG_EQUAL note when a constant is
>         propagated into the src of an assignment.
>
> testsuite/ChangeLog
>
> 2014-08-25  Easwaran Raman  <era...@google.com>
>
>         PR rtl-optimization/62146
>         * testsuite/g++.dg/opt/pr62146.C: New.

Reply via email to