This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [tree-ssa] preliminary l-i reorganization patch


On Sat, 10 Aug 2002, Jason Merrill wrote:

> On Fri, 09 Aug 2002 18:34:15 +0100, Jason Merrill <jason@redhat.com> wrote:
> 
> > This patch, which I'm not checking in, does the bits of reorganization
> > which can be done without actually changing the target language from C
> > trees to language-independent trees.  It:
> >
> > 1) Changes the language hook from simplify_function_tree to simplify_expr,
> >    and splits out c_simplify_expr from simplify_expr.
> > 2) Moves the simplification code for l-i trees to tree-simple.c, and
> >    is_simple tests for C trees to c-simplify.c.  This is not complete, as
> >    some of the code for simplifying l-i trees creates C-specific trees.
> 
> Here's a patch which I am checking in, which only does #1.  Tested
> i686-pc-linux-gnu.
> 
The patch breaks Objective C, but it's relatively easy to fix.
In simplify_function_tree, we implicitly assume that
DECL_SAVED_TREE is a COMPOUND_STMT.  Apparently, that's not
always true in Obj-C.  Bootstraps were failing when compiling
libobjc/linking.m.

I've kludged it for now by returning 0 if the function's body is
not a COMPOUND_STMT.  The only reason we need a COMPOUND_STMT
here is to declare the temporaries created by simplification.
I'm not sure how to deal with the general case here.

Another thing I added is a test for successful simplification.
If simplify_expr fails, we should not proceed to building SSA and
optimizing the trees.  In the future we may even want to abort
(once all the FEs have been converted).

I'll be posting the patch in a bit.

Diego.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]