This is the mail archive of the gcc@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]

Re: Dec alias patch causing regressions


    During dead store elimination we correctly remove insn 46 (there's
    nothing which ever reads the value we stored).  However, we also
    remove insn 16 which is incorrect as the value we store is read by
    insn 21.  [ this happens because we consider the memory references in
    insn 21 and 87 as not aliasing each other because they have different
    alias sets.

That's right: they don't alias each other.  Insn 16 is the
initalization of parameter "tmp" for the inline all to "sub".  It is
of type "struct tmp", which has alias set 4.  Insn 87 is the
initialiation of parameter "tmp2" for the inline call to "sub2".  It
is of type "struct tmp2", which has alias set 5.

These two temporaries do not have overlapping ranges and have
conflicting types, so they can be put in the same location in memory.

The bug is in insn_dead_p in that it should not be using rtx_equal to
see if two memrefs conflict, but rather anti_dependence.  Making that
change fixes the problem, but it will take a number of hours for me to
finish all my tests before I can check it in.


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