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 check
> that all the operands are up-to-date?
>
Another alternative , if you want to check that calling update_stmt
really DOESNT change anything in the operands cache at all, would be to
add a new routine to the operand code which we could call to rebuild the
stmt and compare it to the old operand cache, without actually changing
the stmt. verify_stmt_up2date() or some such thing.
Does this sounds more like what you are interested in?
Andrew