This is the mail archive of the gcc-patches@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: [tree-ssa] [PATCH]: Fix DCE not updating bb->end_tree_p


On Tue, 2003-07-15 at 19:15, Daniel Berlin wrote:
> > bsi_last() has a speed hack in it that predates bsi_prev(), or at least
> > doesnt work with bsi_prev(). I dont recall saying anything about using
> > bsi_last() :-).
> 
> Then how does one iterate through a basic block in reverse, if not 
> starting with bsi_last and using bsi_prev until we hit the start?
> :)

But yes, this is a good question :-)

BUt actually, as I think about it, it doesnt matter, ignore what I said.
It should just always work. bsi_prev is using a new iterator, and that
new iterator will have the correct history. Im just thinking about too
many things at the same time.

Yes.  bsi_last() followed by bsi_prev() is the correct way to do it, and
it should always work.

> >
> > I didnt suggest using bsi_last(). I suggested changing your loop which
> > is going to pass through the previous stmt before it terminates anyway,
> This would require two iterators, rahter than one, since we don't know 
> what the previous statement is before we start.
> 
> So if I did what you said, i'd have effectively copied and pasted what 
> bsi_prev's code is to do this exact same thing, which seems like a very 
> silly thing to do.
> >

You already had most of the implementation in your loop anyway, I was
merely suggesting dont do the work twice.

In any case, it doesnt matter. bsi_last() followed by bsi_prev() should
always work. 

Andrew



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