This is the mail archive of the 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] RFC: Making control flow more explicit

On Wed, 2003-08-06 at 19:12, Steven Bosscher wrote:

> Can you elaborate?  Those comments Zdenek made Last week's about the
> tree IR seem to make sense.  Is it part of your eventual plan to get rid
> of control expressions in the statement chain and represent control flow
> with only the CFG (and insert code after going out of ssa)?  Or is it
> just making control flow more explicit with more GOTO_EXPRs?  (Just that
> would also help in some cases I've seen in the past few days)
For now, I just want to make control flow more explicit.  But, as I
mentioned, I would like us to change the physical representation of the
IR to simplify statement chaining and get rid of its container nature. 
The flowgraph-is-the-IR view might well be what we end up with.  But I'd
like to get there by natural progression.  There is a lot of
infrastructure to change to get to that extreme.

> <dumb look> Why switch the order of the condition and the body?
> What is wrong with just:
> 	loop_top:
> 	if (cond)
> 	  goto loop_end;
> 	body
> 	goto loop_top;
> 	loop_end:
I was trying to generate similar structures for do-while and while
loops, but I forgot that the gimplifier already switches the body and
the test around for do-loops.  Yes, it's simpler the way you suggest.

> While you're working at this:  It would be nice to have LABEL_EXPRs go
> away from the statement chain.  Labels are not expressions, they're
> addresses, and since labels always the first "statements" in a basic
> block leaders, a chain of labels in a basic block always represent the
> same address.  So why not attach something like a varray of LABEL_DECLs
> to a basic block and remove them from the statements chain.  Right now
> they're just in the way.
I can look into it, yes.  Send me a test case where LABEL_EXPRs are a


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