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

Re: [PATCH] Fix (?) load_kills_store


Hello,

> > what you say seems to be correct, except that IMHO the cases 3 and 4
> > don't occur.
> 
> cases 1 and 2 come from store_killed_after.  cases 3 and 4 come from
> store_killed_before.  I built a native x86 linux toolchain, and then
> compiled loop.i with it at -O2.  I put a breakpoint in
> store_killed_before.  I stepped through it, and I hit an instance of
> case 3.  So case 3 obviously occurs.  Since case 3 can occur, it should
> be obvious that case 4 can also occur.

right, I have missed this.

> >         if (GET_CODE (SET_DEST (pat)) == MEM && !expr_equiv_p (SET_DEST (pat), x))
> > ! 	if (output_dependence (x, SET_DEST (pat)))
> 
> This is an improvement, however, it looks like the original code is
> obviously buggy.  This will fail if the SET_DEST holds a
> STRICT_LOW_PART, ZERO_EXTRACT, or SIGN_EXTRACT.  In that case, we will
> ignore the SET_DEST, and may miss an aliased mem.
> 
> So we are now up to 5 different bugs, and your patch only fixes 2 of
> them.  The question is what to do about the other 3.  It would be better
> to fix them, but maybe we can get away with documenting them since we
> don't have testcases for them?

no, it is trivial to fix them (two by saying store_killed_in_insn from
where they are called, the last one by handling these ops). I will
prepare the patch.

Zdenek


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