This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Example program takes 2000 times as long to compile underC++ as C
- To: zack at wolery dot cumb dot org
- Subject: Re: Example program takes 2000 times as long to compile underC++ as C
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Thu, 31 Aug 2000 10:55:14 -0700
- Cc: kelleycook at attglobal dot net, gcc-bugs at gcc dot gnu dot org
- Organization: CodeSourcery, LLC
- References: <000901c012cd$19fde840$5b5f6294@kelley><20000830162923.H13918@wolery.cumb.org>
>>>>> "Zack" == Zack Weinberg <zack@wolery.cumb.org> writes:
Zack> This is not trivial to fix. calls_setjmp_p could be
Zack> replaced by noticing during parsing that we're calling
Zack> setjmp and setting a flag (kinda like the way calls.c does
Zack> it at the RTL level, now).
That's sort-of ugly. I'd like to allow for arbitrary transformations
for as long as possible.
Zack> I think what we want is two variants of walk_tree. One for
Zack> things like no_linkage_check, that really do need to visit
Zack> each node; one for things like calls_setjmp_p and the new
Zack> prune_unused_decls, that only visits statement nodes. I'm
Zack> not sure what to do with simplify_aggr_init_exprs_r.
Yes. This goes back to what I was talking about earlier sbout trying
to more rigorously define tree structure so as to form something less
cyclic. Mark bits may be a good short-term solution, though. (If we
can convert the Java front-end to use GC, I was planning on reclaiming
TREE_PREMANENT, which is otherwise unused.) That will require two
walks of the tree structure, though, and it's hard if walk_tree is
being used to mutate the tree structure.
There are some other design issues here, as well. I would prefer that
DECL_INIT for a VAR_DECL be used only for simple constant
initializers, and that other initializations be inserted in the code
stream. That will make for easier optimization later, as well as
simplifying the issues you refer to.
What you say about TREE_TYPE is extremely valid. I've been meaning to
outfit walk_tree with some flags that say whether or not to walk into
types for quite a while. For lots of tree-walks we don't need to walk
into types at all. (I think that there is some confusion in that some
ARRAY_TYPEs have bounds that are complex expressions. I think that's
a mistake -- the language doesn't have any such type, and so neither
should we. Those things should be ARRAY_TYPEs with no known bounds.
These arise when you say something like `new int[f()];', for example.)
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com