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



  In message <10103121206.AA16681@vlsi1.ultra.nyu.edu>you write:
  >     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.

No, that's not a complete solution.  Consider that if the memory locations
do not conflict, then the scheduler may also reorder those instructions and
we can get incorrect code.

We really need to avoid multiple references to the same memory locations
with different alias sets.  That's bad.  It's very bad.


jeff


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