This is the mail archive of the gcc@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: Work in progress: "Super Sib Calls"; opinions sought


Fergus Henderson writes (9. September 2002):
 > On 09-Sep-2002, Richard Henderson <rth@redhat.com> wrote:
 > > On Mon, Sep 09, 2002 at 07:49:22PM +1000, Andreas Bauer wrote:
 > > > So, what I'm trying to do is offer a more general stack re-usage for calls
 > > > in tail position, even if the sib call optimisation fails.  That is, I'm
 > > > generating RTL code similar to an ordinary call for each tail call, but
 > > > I'm moving the args back into the incoming arg space, _after_ they're all
 > > > evaluated and have been mangled via the outgoing arg space.
 > > 
 > > Personally, I see this as the _easy_ part.
 > 
 > GOOD!  Let's tackle the easy parts first.

completely agreed
we should tackle this challenge step by step instead of capitulating
the effort is worth it

 > Break the task down into small parts, and when the easy
 > ones are done, then the hard ones will be easier...

exactly

 > > The hard part is distinguishing 
 > > 
 > > 	void foo()
 > > 	{
 > > 	  int x[100];
 > > 	  // something local that uses x
 > > 	  bar();  // legal to tail-call
 > > 	}
 > > 
 > > 	void baz()
 > > 	{
 > > 	  int x[100];
 > > 	  global = x;
 > > 	  bar();  // *not* legal to tail-call, since bar may reference x
 > > 	}
 > 
 > Right.  I think Andreas is not trying to distinguish between these two,
 > but is planning to use the explicit annotation approach that I
 > posted some time ago.  In other words, we'd distinguish between those and
 > 
 >  	void quux()
 >  	{
 >  	  int x[100];
 >  	  global = x;
 >  	  __tailcall bar(); /* legal to tail-call;
 > 	  	the annotation implies that
 > 		bar is not allowed to reference x. */
 >  	}
 >
 > But this can be dealt with by a separate patch.
 > It doesn't need to be part of Andreas' change.

exactly,
I think the explicit annotation is a reasonable starting point to tackle
the tailcall problem

 > > If you do not plan to address this data flow issue in some way,
 > > you might as well quit now.
 > 
 > Hey, we don't want to unnecessarily discourage volunteers, do we? ;-)

No, we definetely don't.
Andreas work is valuable and important to further propagate gcc as the most
suitable or even unique solution to a wide range of applications 

 > The data flow issue does need to be addressed eventually.
 > But I don't think it needs to be addressed right away;

agreed

 > improving sibcall to better handle overlapping arguments
 > would already be a useful improvement.
 > The data flow issues can be address by the explicit annotation
 > approach that I suggested earlier.


--
   Markus Pizka

 -------------------------------------------------------------
 Dr. Markus Pizka                              pizka@in.tum.de
 Technische Universitaet Muenchen, Institut für Informatik I4
 room: 01.11.053, Boltzmannstr. 3, D - 85748 Garching
 Tel: +49 89 289-17334                   Fax: +49 89 289-17307
 -------------------------------------------------------------


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