[4.9] PR 62146

Easwaran Raman eraman@google.com
Fri Sep 5 01:28:00 GMT 2014

I've attached the revised patch. Bootstrapped and no test regressions
on x86_64/linux with 4.9 branch. Ok for 4.9 branch? While the bug
doesn't show up in trunk, seems obvious that this should go to trunk
as well. Is it ok for trunk if tests pass?

Btw, is g++.dg/opt the right directory for the test to go?



2014-09-04  Easwaran Raman  <eraman@google.com>

        PR rtl-optimization/62146
        * ifcvt.c (dead_or_predicable): Make removal of REG_EQUAL note of
        hoisted instruction unconditional.

2014-09-04  Easwaran Raman  <eraman@google.com>

        PR rtl-optimization/62146
        * testsuite/g++.dg/opt/pr62146.C: New.

On Wed, Sep 3, 2014 at 11:36 AM, Jeff Law <law@redhat.com> wrote:
> On 09/02/14 12:52, Easwaran Raman wrote:
>> It turns out that the REG_EQUAL note is removed on a hoisted
>> instruction (relevant code is in dead_or_predicable in ifcvt.c) if the
>> source of the move instruction is not a function invariant. In this
>> case, the source is a function invariant (constant) and so that
>> doesn't kick in. I don't understand why this exemption for function
>> invariant is there and the original thread in
>> https://gcc.gnu.org/ml/gcc/2005-05/msg01710.html doesn't explain
>> either. Should I just remove the REG_EQUAL notes of all hoisted
>> instructions or are there cases where it is safe to leave the note?
> I suspect it was left in in an attempt to keep as many REG_EQUAL notes as
> possible as the notes can help later optimizations.  But even those
> equivalences are not necessarily safe.
> I'm pretty sure the right thing to do here is just drop the note regardless
> of whether or not its an invariant.
> jeff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr62146.patch
Type: text/x-patch
Size: 1888 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20140905/ad11b985/attachment.bin>

More information about the Gcc-patches mailing list