This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] inlining now works on bnw-simple-branch
- From: Richard Henderson <rth at redhat dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: Diego Novillo <dnovillo at redhat dot com>, gcc at gcc dot gnu dot org
- Date: Mon, 23 Sep 2002 17:05:26 -0400
- Subject: Re: [tree-ssa] inlining now works on bnw-simple-branch
- References: <wvl7khdx4ra.fsf@prospero.cambridge.redhat.com>
On Sun, Sep 22, 2002 at 07:23:37PM +0100, Jason Merrill wrote:
> Another possible fix would be to simplify to
>
> if (a)
> if (b)
> c;
[...]
> The same alternate simplification would fix the && case, but the || case is
> more difficult. We could simplify to something like
>
> if (a) goto in;
> if (b)
> {
> in:
> c;
> }
>
> or
>
> if (a);
> else if (b);
> else goto not;
> c;
> not:
>
> but nothing without either a goto or an extra test.
You can't handle && without a goto either.
if (a && b)
c;
else
d;
becomes either
if (a)
if (b)
c;
else
goto not;
else
not: d;
or
if (a)
if (b)
{
c;
goto done;
}
d;
done:
That said, I think we _should_ generate code like this, since
it would make life easier for the global optimizers wrt
conditional constant propagation. Plus, if the structure of
these conditions makes it all the way to rtl, we eliminate a
branch from both paths.
r~