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]

Re: [PATCH] Optimization for walk_tree



  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


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