This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [4.9] PR 62146
- From: Easwaran Raman <eraman at google dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Brooks Moses <bmoses at google dot com>, Richard Biener <rguenther at suse dot de>
- Date: Wed, 27 Aug 2014 16:00:53 -0700
- Subject: Re: [4.9] PR 62146
- Authentication-results: sourceware.org; auth=none
- References: <CAPK5YPYawDfrFe45fR7s+y20UeXonHAW4jVKQGnKp3OFK71cHw at mail dot gmail dot com>
On Mon, Aug 25, 2014 at 3:42 PM, Easwaran Raman <eraman@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 <eraman@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 <eraman@google.com>
>
> PR rtl-optimization/62146
> * testsuite/g++.dg/opt/pr62146.C: New.