This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Possible C parsing speedup?
- To: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Subject: Possible C parsing speedup?
- From: "Turly O'Connor" <turly at apple dot com>
- Date: Wed, 24 May 2000 14:07:46 -0700
Hello there,
I have a question/observation about code in FINISH_STRUCT, c-decl.c,
line 5376 in the egcs-20000508 snapshot.
> ...
>/* If this structure or union completes the type of any previous
> variable declaration, lay it out and output its rtl. */
>
>if (current_binding_level->n_incomplete != 0)
> {
> tree decl;
> for (decl=current_binding_level->names; decl; decl=TREE_CHAIN(decl))
This does a linear search though every name in the current binding
if N_INCOMPLETE is zero. Unfortunately, on our ports, N_INCOMPLETE
in the global binding starts off nonzero after initialisation.
(Because PUSHDECL is called with "VOID", which doesn't have a size.)
From what I can see this would be true of all ports, but it could
be just ours.
Substantial parse speed improvements are possible by fixing this;
I have a trivial fix which maintains a list of incomplete variables
and searches that list rather than the entire binding, but as I
don't really know a lot about this area, I thought it best to turn
the problem over to the gcc SmartFriends (tm).
Have Fun!
--turly
--
"When I read about the evils of drinking, I gave up reading."
--Henny Youngman