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/69195] [4.9/5/6 Regression] gcc.dg/torture/pr44913.c FAILs with -O3 -fno-dce -fno-forward-propagate


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

Alan Modra <amodra at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amodra at gmail dot com

--- Comment #11 from Alan Modra <amodra at gmail dot com> ---
The first thing I noticed when looking at rtl dumps for this bug is
that -fno-dce makes a difference to the REG_EQUIV notes emitted by the
ira pass.

With -fno-dce we get this:
(insn 6 41 8 2 (set (reg:DI 173)
        (mem/u/c:DI (reg/f:DI 172) [0  S8 A32])) /src/tmp/pr69195.c:15 549
{*movdi_internal64}
     (expr_list:REG_EQUIV (mem/u/c:DI (reg/f:DI 172) [0  S8 A32])
        (nil)))

With -fdce we get:
(insn 6 41 8 2 (set (reg:DI 173)
        (mem/u/c:DI (reg/f:DI 172) [0  S8 A32])) /src/tmp/pr69195.c:15 549
{*movdi_internal64}
     (expr_list:REG_EQUIV (mem/c:DI (plus:DI (reg/f:DI 113 sfp)
                (const_int 96 [0x60])) [1 a+0 S8 A128])
        (nil)))

I think the second note is invalid.  Reg 173 is *not* the same as the
stack location at this point.  (It is after the reg has been stored.)

The reason the notes are different is that in the -fno-dce case
ira.c:3566 call to validate_equiv_mem returns true, whereas when dce
is enabled it returns false due to hitting a REG_DEAD for reg 172
(ira.c:2992) before seeing REG_DEAD for reg 173.  This in turn leads
to ira.c:3677 setting the note.  It's interesting that ira.c:3679
correctly comments that the store is the insn making the equivalence,
not the load, but leaves the note of the load regardless..

Another curious fact is that ira with -fno-dce deletes the same dead
loads removed by -fdce, but in this case by the call to
delete_trivially_dead_insns in ira, *after* the update_equiv_regs call
that creates the reg notes.  Deleting those insns of course moves the
REG_DEAD note for reg 172 earlier, before the store that goes wrong.

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