This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Optimization for walk_tree
- To: Jakub Jelinek <jakub at redhat dot com>
- Subject: Re: [PATCH] Optimization for walk_tree
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Wed, 21 Jun 2000 09:53:25 -0600
- cc: gcc-patches at gcc dot gnu dot org
- Reply-To: law at cygnus dot com
In message <20000621152315.D474@sunsite.ms.mff.cuni.cz>you write:
> Hi!
>
> gcc does not recognize
> int foo(void)
> {
> int r;
> do {
> r = foo(void);
> if (r) return r;
> } while (0);
> return 0;
> }
Well, in function-at-a-time mode we might be able to detect that the loop
iterates exactly once (and thus isn't a loop). That in turn would allow for
the possibility of a tail call optimization.
> sequence as tail call recursion, and I guess it will take quite some time
> till it will. So I think we should help it a little bit in walk_tree to
> speed things up a little bit.
Have you done any profiling which indicated that walk_tree is important?
I'd much perfer to keep code simple, except in those cases where there is
a measurable performance impact for making the code more complex.
jeff