Chain PHI nodes via separate a chain field

Steven Bosscher s.bosscher@student.tudelft.nl
Wed Jun 16 20:52:00 GMT 2004


On Wednesday 16 June 2004 19:17, Zack Weinberg wrote:
> > So it seemed like a safer approach to just make PHI_CHAIN use a new
> > field, so that bugs show up right away.
>
> Safety is good, but bulking up memory consumption is definitely the
> wrong direction.  Can we see this ugly hack?  I wouldn't be surprised
> if it can be made nice(r) ... and I think we're going to have to go
> there eventually, if you continue with these (which I hope you do).

I already removed the hack, but basically it involves:
- creating a new #define TREE_CHECK_NOT(NODE,CODE) which aborts
  when TREE_CODE(NODE) == CODE
- cleaning up the GTY chain_{next,prev} markers from lang_tree_node
  because normally you walk the trees via their TREE_CHAIN
- re-adding those markers in tree.h to the union tree_node members
  that need it.

Note that I only did this to find the non-obvious places where
we'd walk phis via their TREE_CHAIN (I only found that one call
to nreverse).  This idea would have to be extended every time
somebody moves the chain field for another tree_node member, ie.
when decl nodes have their own chain field, you'd have to create
TREE_CHECK_NOT_2, etc.
This also makes tree checking significantly more expensive.

Gr.
Steven




More information about the Gcc-patches mailing list