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]
Other format: [Raw text]

Re: PATCH for sibcalls on i386


Hi Zack and others,

I have followed your advise and attached the first rather "mechanical"
patch of my series of patches.  However, I did have to make a _small_
change to calls.c in order to let it use the new interface to
FUNCTION_OK_FOR_SIBCALL:

Index: calls.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/calls.c,v
retrieving revision 1.231.4.5
diff -u -p -r1.231.4.5 calls.c
--- calls.c     20 Sep 2002 01:29:06 -0000      1.231.4.5
+++ calls.c     24 Sep 2002 04:07:43 -0000
@@ -37,7 +37,7 @@ Software Foundation, 59 Temple Place - S
 #include "target.h"
 
 #if !defined FUNCTION_OK_FOR_SIBCALL
-#define FUNCTION_OK_FOR_SIBCALL(DECL) 1
+#define FUNCTION_OK_FOR_SIBCALL(DECL, EXP) 1
 #endif
 
 /* Decide whether a function's arguments should be processed
@@ -2453,7 +2453,7 @@ expand_call (exp, target, ignore)
       || fndecl == NULL_TREE
       || (flags & (ECF_RETURNS_TWICE | ECF_LONGJMP))
       || TREE_THIS_VOLATILE (fndecl)
-      || !FUNCTION_OK_FOR_SIBCALL (fndecl)
+      || !FUNCTION_OK_FOR_SIBCALL (fndecl, exp)
       /* If this function requires more stack slots than the current
         function, we cannot change it into a sibling call.  */
       || args_size.constant > current_function_args_size

> First make the mechanical changes necessary to add the 'exp' parameter
> to FUNCTION_OK_FOR_SIBCALL, and update the documentation.  Do not
> change calls.c or any of the definitions at this stage.

Attached is a rather large patch which adds the 'exp' to all the targets
in the config/ directory.  This alone, of course, does not offer the new
functionality, but it extends the interfaces, compiles & doesn't break
anything, and (hopefully) let's us continue with Step 2.

> Please consider turning FUNCTION_OK_FOR_SIBCALL into a "target hook"
> with this patch, too.

Please, send me more information on this request, if it's important or
relevant to you.

Cheers,
Andi.

P.S. also look carefully at my documentation change, as I'm not a native
English speaker.  :-)

Attachment: config.diff
Description: Text document

Attachment: tm.texi.diff
Description: Text document


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