This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Tree-SSA self checking infrastructure
- From: Jan Hubicka <jh at suse dot cz>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 19 Nov 2003 18:44:50 +0100
- Subject: Tree-SSA self checking infrastructure
Hi,
I was thinking about the current somwhat frustrating situation
concerning dependency of tree-SSA branch on the environment it is tested
in. Obivously the amount of existing bugs is high enought so while
testing patch on one machine I fix only those bugs affecting it hitting
other bugs later as unpleasant surprise.
One thing that never hurts is extra sanity checking in the compiler.
On RTL, implementing any self checking feature is dificult given how
complex the code base is and how many times it breaks the interfaces.
For tree-SSA this should be easier, so I would like to do some work on
it. Here I would like to ask for ideas what shall be implemented. So
far I can come up with:
1) Gimple testing
a) verifying that each stmt is gimple is trivial, will hook it into
verify_flow_info, or shal I invent verify_stmt/verify_stmts?
b) verifying gimple types is almost impossible now. The reason is
ssa_useless_type_conversion. Where we got about the plans to make it
transitive and symteric?
c) I commonly got hit by the feature of gimple allowing almost
arbitrarily complex constant operands. What about restricting it
into primitive constants +
(plus_expr (nop_expr (addr_exr )) (integer_cst) as the most complex
form?
d) We should verify gimple sharing restrictions. But what are these?
We share constant nodes now. I think we share constant
expressions as well. What else can be shared?
e) We should maintain invariant that no statements fold further after
each optimization pass. THis is currently not the case as gimplifier
can produce unfolded statements. Doing fold_stmt as part of
remove_useless_* uncovers latent bugs in fold_stmt. Any plans on
fixing the folders and any progress on this?
2) CFG testing
I believe that verify_flow_info is now mostly feature complette, but
in the case you notice some missed tests, please let me know
3) SSA form testing
We should have verify_ssa that ensures that stream is in valid SSA
form. I am not quite sure how to best implement this, but I guess I
can simply verify that all the pointers points corectly and that each
use is dominated by the def it points to. Correct?
This also brings me into question how the rewrite_into_ssa updates
the SSA form. What happens when the variable has been already
optimized so live ranges of it's SSA_NAMES overlap and I ask for
variable SSA form to be recomputed?
4) Aliasing
I think I can check that TREE_ADDRESSABLE is set for each argument of
ADDR_EXPR. This is somewhat stupid, but seems to break in current
tree in many interesting ways. More ideas?
I will try to work on this plan now and delay my other projects of
improving testsuite, so any ideas are welcome soon :)