This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] COND_EXPR lowering.
On Fri, 2003-10-24 at 12:41, Andrew MacLeod wrote:
> On Fri, 2003-10-24 at 12:32, Diego Novillo wrote:
> > On Fri, 2003-10-24 at 09:22, Andrew MacLeod wrote:
> >
> > > The only other thing that I think Diego agreed with (yes? no?) is that
> > > we probably ought to set the BB for the 2 goto's on the arms of the
> > > COND_EXPR. Yeah, they aren't real stmt's, but there is no reason someone
> > > couldn't look at them as real stmts.. ie, someone doing path following
> > > may want to process the 2 arms exactly like they process a GOTO, so we
> > > ought to make them behave like a GOTO stmt for consistancy, so we ought
> > > to set their BB.
> > >
> > Agreed. It's easy enough to change set_bb_for_stmt() to do this
> > automatically when applied to the COND_EXPR node.
> >
> If we were to do it, that wouldnt be good enough. Anyone that later
> changes the THEN or ELSE branch would have to update that GOTO as well,
> so it is more maintenance.
>
Why? Statement replacement always preserves the existing basic block
for the statement. And if something is going to change the block for
one of the GOTOs without changing the COND_EXPR, that's a bug.
Diego.