This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] COND_EXPR lowering
- From: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- To: Diego Novillo <dnovillo at redhat dot com>
- Cc: Andrew Macleod <amacleod at redhat dot com>,gcc-patches <gcc-patches at gcc dot gnu dot org>, Jeff Law <law at redhat dot com>
- Date: Thu, 9 Oct 2003 15:53:53 +0200
- Subject: Re: [tree-ssa] COND_EXPR lowering
- References: <20030918193545.GA14011@atrey.karlin.mff.cuni.cz> <1065632546.2629.182.camel@p4> <1065707246.6205.9.camel@frodo.toronto.redhat.com>
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