This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] RFC: Making control flow more explicit
- From: neroden at twcny dot rr dot com (Nathanael Nerode)
- To: gcc at gcc dot gnu dot org
- Date: Thu, 7 Aug 2003 15:13:34 -0400
- Subject: Re: [tree-ssa] RFC: Making control flow more explicit
>COND_EXPR
>---------
>
>Instead of having:
>
> if (cond)
> then_clause;
> else
> else_clause;
>
>we would have
>
> if (cond)
> goto then_lab;
> goto else_lab;
>
> then_lab:
> then_clause;
> goto endif_lab;
>
> else_lab:
> else_clause;
>
> endif_lab:
Um.
It doesn't sound like a good idea to do this kind of thing (reducing
high-level structures to GOTOs) too early. It's quite likely that there
will be optimizations developed in future which operate more easily on
the high-level structure than on the masses of GOTOs, and I doubt that
we want to make our lives more difficult when they appear.
Accordingly, if you're going to do this (which may be a good idea), may
I suggest not doing it to GENERIC trees immediately, but rather
implementing it as a specific pass on the tree structure? It is
possible (likely?) that one would want to place this pass after the
inliner, for instance. (The comments someone else made about WHIRL are
relevant background here.)
--
Nathanael Nerode <neroden at gcc.gnu.org>
http://home.twcny.rr.com/nerode/neroden/fdl.html