This is the mail archive of the gcc@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: [RFC] Use accessor macros for the head and end of a basic block


> On Monday 08 December 2003 16:30, Steven Bosscher wrote:
> > Hello,
> >
> > For tree-ssa I would like to make the basic block head/end a union because
> > we now have a head and end for both RTL and trees, and obviously we only
> > can use one at a time so one field at least is redundant.
> >
> > Problem is, everything uses bb->head instead of BLOCK_HEAD (bb), and
> > bb->end instead of BLOCK_END (bb).  Is there a reason for this?  Would a
> > patch to update _all_ of these to use the macro be acceptable in stage3 if
> > it prevents merge trouble for the tree-ssa branch maintainers?
> 
> Of course the BLOCK_HEAD and BLOCK_END macros aren't the right ones. We'd need 
> two new macros...
> 
> (BLOCK_{HEAD,END} are hardly used, and it seems that at least in reload we 
> could use a pointer to a basic block instead of an int in insn_chain.  But 
> that's for later.)

There are artefact of dark ages when it seemed to be good idea to
implement CFG using arrays AFAIK.
> 
> Now, here's the change I'd like to make.  This is probably already the largest 
> patch I've ever submitted, but it should have no effect whatsoever.  
> Basically all this does is replace all occurences of "<bb>->{head,end}" with 
> "BB_{HEAD,END} (<bb>).
> (Diego, this is one of those changes I was talking about last week, and as you 
> can see it touched matter all over the map.)
> 
> This patch does not convert all files at once, because this was a large (and 
> RSI-prone ;-) amount of work, I'm extremely lazy and if this is unacceptable 
> then I won't have to do the rest of them.
> 
> If a patch like this is not OK for mainline at this stage, then some CFG work 
> that I had in mind for tree-ssa (putting will have to be postponed until 
> after 3.4 branches.  But really, I'd like to put this in now because:
> 1. It is quite safe.
> 2. Not doing it makes it very impractical to make basic_block_def a bit
>    smaller for tree-ssa, where this is needed especially now that we
>    have a garbage collectable CFG.
> 
> Opinions? Should I finish this patch or is this just a big no-no?

I think it is right thing to do.  How will the tree counterparts called?
Perhaps we can use BLOCK_HEAD_RTL/BLOCK_HEAD_TREE to make naming more
conventient.

Honza


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