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] COND_EXPR lowering


Hello,

> > Now the that COND_EXPR has a goto on each arm, are we deciding to treat
> > the arms *not* as stmt's at all?  ie, It appears to me that we never set
> > the basic block nor the parent of the GOTO's on each arm. Im not sure
> > that this is a good thing. What do others think?
> >
> In principle, I don't see a huge problem in treating it as an
> indivisible unit.  This means, though that all three expressions *must*
> be assigned to the the same basic block (the COND_EXPR and both
> GOTO_EXPRs).
> 
> If needed, we could provide wrapper functions to access COND_EXPRs.  The
> obvious advantage of treating the 3 expressions as a single statement is
> the reduction in basic block.
> 
> However, what happens if we want to remove one of the branches?  We'll
> need to do something special for COND_EXPR when we remove the label.  It
> won't "just happen" because the GOTO_EXPRs aren't regular statements
> anymore.

I don't quite understand your point here.  When one of branches is
removed, the COND_EXPR is just replaced by a GOTO expr. There is nothing
more on this, since the branches are not considered separate statements
and they are not reachable by any other means than by pattern matching
on the COND_EXPR statement.

Zdenek


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