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]

[fortran patch] Don't use TREE_LISTs for storing arguments to intrinsic functions


Hi,

This patch modifies the handing of intrinsic functions to not use a
TREE_LIST for storing the arguments to instead use a stack allocated
array and use the new CALL_EXPR constructors. In order to make this
work, I've modifed gfc_conv_intrinsic_function_args to take two new
parameters - a pre-allocated array of arguments to be populated and a
length parameter to denote the number of elements. All callers of this
function have been modifed to allocate an array of the correct size to
pass into this function and update uses of the arguments with them
accordingly.

For most of the callers, the number of arguments required is already
known. However, in some cases this isn't true so a new function
(gfc_intrinsic_argument_list_length) has been added that returns the
number of arguments for an intrinsic function to use for allocating
the arguments array.

Bootstrapped and regression tested with no new failures on
i686-pc-linux-gnu, ok to apply?

Cheers,
Lee.

2007-05-07 Lee Millward <lee.millward@codesourcery.com>

	* trans-intrinsic.c (gfc_conv_intrinsic_function_args): Adjust
	to operate on a stack allocated array for the intrinsic arguments
	instead of creating a TREE_LIST. Add two new parameters for the
	array and the number of elements. Update all callers to allocate
	an array of the correct length to pass in.
	(gfc_intrinsic_argument_list_length): New function.
	(gfc_conv_intrinsic_mnimax): Call it.
	(gfc_conv_intrinsic_merge): Likewise.
	(gfc_conv_intrinsic_lib_function): Call it. Use new CALL_EXPR
	constructors.
	(gfc_conv_intrinsic_cmplx): Likewise.
	(gfc_conv_intrinsic_ctime): Likewise.
	(gfc_covn_intrinsic_fdate): Likewise.
	(gfc_conv_intrinsic_ttynam): Likewise.
	(gfc_conv_intrinsic_ishftc): Likewise.
	(gfc_conv_intrinsic_index): Likewise.
	(gfc_conv_intrinsic_scan): Likewise.
	(gfc_conv_intrinsic_verify): Likewise.
	(gfc_conv_intrinsic_trim): Likewise.
	(gfc_conv_intrinsic_aint): Use new CALL_EXPR constructors.
	(gfc_conv_intrinsic_exponent): Likewise.
	(gfc_conv_intrinsic_bound): Likewise.
	(gfc_conv_intrinsic_abs): Likewise.
	(gfc_conv_intrinsic_mod): Likewise.
	(gfc_conv_intrinsic_sign): Likewise.
	(gfc_conv_intrinsic_len): Likewise.
	(gfc_conv_intrinsic_adjust): Likewise.
	(gfc_conv_intrinsic_si_kind): Likewise.

Attachment: intrinsic_patch.txt
Description: Text document


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