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]

PATCH turning FUNCTION_OK_FOR_SIBCALL into target hook


Dear gcc hackers,

The attached patches (It's really only one patch as none of the two files
would work without the other, but I have put gcc/ changes into `gcc.diff'
and changes of gcc/conf/ into `conf.diff'.  Hope that's ok.)  are a result
of the fruitful discussion on the thread "PATCH for sibcalls on i386".
The patches mainly turn the macro FUNCTION_OK_FOR_SIBCALL into a target
hook and specify the (new) functions for all affected targets accordingly.

In a second step, I aim to send a patch expanding the machine
descriptions for at least x86 targets in order to allow at least some
optimisation of indirect calls.  (But that is not subject of discussion
just yet.  I'm still working on it and take Richard's, Fergus' and other
people's comments on it into account.)

Furthermore, I have built several different cross-compilers (as suggested)
for arm, hppa, rs6000, etc. to verify that I have not introduced new and
unnecessary warnings on these platforms.

Here's the ChangeLog for the attached patch:

2002-10-01  Andreas Bauer  <baueran@in.tum.de>

	* calls.c (expand_call): Remove the `no indirect check'
	for sibcall optimization; use function_ok_for_sibcall
	target hook; refine check for `function is volatile'.
	(FUNCTION_OK_FOR_SIBCALL): Remove the redefinition.
	* hooks.c (hook_tree_tree_bool_false): New.
	* hooks.h (hook_tree_tree_bool_false): Declare.
	* target-def.h (TARGET_FUNCTION_OK_FOR_SIBCALL): New.
	(TARGET_INITIALIZER): Add it.
	* target.h (struct gcc_target): Add function_ok_for_sibcall.
	* config/alpha/alpha.c: (alpha_function_ok_for_sibcall): New.
	(TARGET_FUNCTION_OK_FOR_SIBCALL): Redefine accordingly.
	* config/alpha/alpha.h: (FUNCTION_OK_FOR_SIBCALL): Remove.
	* config/arm/arm-protos.h: (arm_function_ok_for_sibcall):
	Remove function declaration.
	* config/arm/arm.c: (arm_function_ok_for_sibcall): Make
	function static and accept another argument of type `tree'.
	(TARGET_FUNCTION_OK_FOR_SIBCALL): Redefine accordingly.
	* config/arm/arm.h: (FUNCTION_OK_FOR_SIBCALL): Remove.
	* config/frv/frv.h: (FUNCTION_OK_FOR_SIBCALL): Remove.
	* config/i386/i386.c: (ix86_function_ok_for_sibcall): New.
	(TARGET_FUNCTION_OK_FOR_SIBCALL): Redefine accordingly.
	* config/i386/i386.h: (FUNCTION_OK_FOR_SIBCALL): Remove.
	* config/pa/pa-linux.h: (FUNCTION_OK_FOR_SIBCALL): Remove.
	(TARGET_HAS_STUBS_AND_ELF_SECTIONS): New definition.
	* config/pa/pa.c: (pa_function_ok_for_sibcall): New.
	(TARGET_FUNCTION_OK_FOR_SIBCALL): Redefine accordingly.
	* config/pa/pa.h: (FUNCTION_OK_FOR_SIBCALL): Remove.
	* config/rs6000/rs6000-protos.h: (function_ok_for_sibcall):
	Remove function declaration.
	* config/rs6000/rs6000.c: (rs6000_function_ok_for_sibcall):
	Rename function_ok_for_sibcall to rs6000_function_ok_for_sibcall;
	rename first argument to `decl'; accept another argument
	of type `tree'; make static.
	(TARGET_FUNCTION_OK_FOR_SIBCALL): Redefine accordingly.
	* config/rs6000/rs6000.h: (FUNCTION_OK_FOR_SIBCALL): Remove.
	* config/sh/sh.c: (sh_function_ok_for_sibcall): New.
	(TARGET_FUNCTION_OK_FOR_SIBCALL): Redefine accordingly.
	* config/sh/sh.h: (FUNCTION_OK_FOR_SIBCALL): Remove.
	* config/sparc/sparc.c: (sparc_function_ok_for_sibcall): New.
	(TARGET_FUNCTION_OK_FOR_SIBCALL): Redefine accordingly.
	* config/sparc/sparc.h: (FUNCTION_OK_FOR_SIBCALL): Remove.
	* config/xtensa/xtensa.h: (FUNCTION_OK_FOR_SIBCALL): Remove.

I'm looking forward to your feedback.

Cheers,
Andi.

Attachment: gcc.diff
Description: Text document

Attachment: config.diff
Description: Text document


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