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: Diego Novillo <dnovillo at redhat dot com>
- To: Andrew Macleod <amacleod at redhat dot com>
- Cc: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Jeff Law <law at redhat dot com>
- Date: Thu, 09 Oct 2003 09:47:27 -0400
- Subject: Re: [tree-ssa] COND_EXPR lowering
- Organization: Red Hat Canada
- References: <20030918193545.GA14011@atrey.karlin.mff.cuni.cz> <1065632546.2629.182.camel@p4>
On Wed, 2003-10-08 at 13:02, Andrew MacLeod wrote:
> 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.
Having this kind of magic has given us trouble before (hiding
BIND_EXPRs, for instance). So, I'm not sure I like the idea. I guess
we could try it out and see.
Diego.