This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Dec alias patch causing regressions
- To: law at redhat dot com
- Subject: Re: Dec alias patch causing regressions
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Date: Mon, 12 Mar 01 07:06:42 EST
- Cc: gcc at gcc dot gnu dot org
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.