This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Call update_stmt in verify_ssa
On Thu, 2005-04-14 at 15:23, Zdenek Dvorak wrote:
> Hello,
>
> > > this patch makes verify_ssa to call update_stmt on the statements it
> > > verifies. This helps to catch problems with updating of virtual
> > > operands, concretely the situation where the memory reference is
> > > modified in such a way that the virtual operands derived from it no
> > > longer match the recorded virtual operands.
> > >
> > > Bootstrapped & regtested on i686. At the moment, this patch causes
> > > basically all vectorizer tests to fail due to bug in vectorizer.
> >
> > No, this is not ok.
> >
> > By calling update_stmt on every stmt, you are going to cause the
> > verifier to miss every other bug related to immediate uses and lack of
> > lazy updating. Any stmt which was left out-of-date by an optimization
> > would now be updated by verify_ssa before we go looking for them..
> >
> > Your bug is a different one. If you have changed a memory reference and
> > need to assert that everything has been updated in this manner, I
> > suggest something like calling verify_ssa at the end of your
> > optimization (if checking is enabled), then do this loop to update all
> > the stmts, and let the end-of-pass verify_ssa call ensure that
> > everything is ok.
>
> this does not seem like a good way to me. This would need changes
> wherever verify_ssa is used. Perhaps verify_ssa should instead chec
> that all the operands are up-to-date?
it does that by checking the modify bit. When a stmt is changed that
requires operand scanning, either the optimization calls update_stmt to
rebuild the operands, or it marks the modify bit like alias/dom does and
calls update_stmt on all the modified stmts at the end
So.
If you have stmt's which need to have the operands updated, why is
update_stmt not called on the stmt when the change is made? Thats what
it is for.
If you are changing aliasing like tree-ssa-alias.c does, and you require
the stmts to be out of date for a while, then you need to revert to the
same system alias uses... when you change a stmt, mark it modified
instead of calling update_stmt. Then at the end, call
update_stmt_if_modified on all those stmts.
calling update_stmt in verify_ssa defeats the entire purpose of not
having lazy statement updating. It will also cause bugs in non-checking
code because the stmts are in a different state when checking is
disabled then.
Andrew