[fortran-dev] constructor work, part I; updated

Daniel Franke franke.daniel@gmail.com
Thu Dec 24 02:23:00 GMT 2009


On Wednesday 23 December 2009 17:37:01 I wrote:
> To see if it actually works as intended, arith.c, decl.c and expr.c were
> already transformed to use the new API. As some inserts on tail-pointers
> were replaced by list traversals from begining to end, compile-time
> performance degraded a bit (testcase gfortran.dg/initialization_21.f90
> times out).

I spent some more time on this, revamped the iterator interface again and 
converted all files but data.c - attached patch contains the accumulated 
changes.

In the next step, I'll also convert data.c and remove the con_by_offset member 
from gfc_expr.

Afterwards, drop the list implementation and move to a splay-tree.

Regression tested on i686-pc-linux-gnu. Still one performance regression.
Ok for fortran-dev?

Cheers

	Daniel


2009-12-24  Daniel Franke  <franke.daniel@gmail.com>

        * constructor.h: New.
        * constructor.c: New.
        * Make-lang.in: Add new files to F95_PARSER_OBJS.
        * arith.c (reducy_unary): Use constructor API.
        (reduce_binary_ac): Likewise.
        (reduce_binary_ca): Likewise.
        (reduce_binary_aa): Likewise.
	* check.c (gfc_check_pack): Likewise.
	(gfc_check_reshape): Likewise.
	(gfc_check_unpack): Likewise.
        * decl.c (add_init_expr_to_sym): Likewise.
        (build_struct): Likewise.
	* dependency.c (gfc_check_dependency): Likewise.
	(contains_forall_index_p): Likewise.
	* dump-parse-tree.c (show_constructor): Likewise.
        * expr.c (free_expr0): Likewise.
	(gfc_copy_expr): Likewise.
	(gfc_is_constant_expr): Likewise.
        (simplify_constructor): Likewise.
        (find_array_element): Likewise.
        (find_component_ref): Likewise.
        (find_array_section): Likewise.
	(find_substring_ref): Likewise.
        (simplify_const_ref): Likewise.
        (scalarize_intrinsic_call): Likewise.
        (check_alloc_comp_init): Likewise.
        (gfc_default_initializer): Likewise.
        (gfc_traverse_expr): Likewise.
	* iresolve.c (gfc_resolve_reshape): Likewise.
	* module.c (mio_constructor): Likewise.
	* primary.c (build_actual_constructor): Likewise.
	* resolve.c (resolve_structure_cons): Likewise.
	* simplify.c (is_constant_array_expr): Likewise.
	(init_result_expr): Likewise.
	(transformational_result): Likewise.
	(simplify_transformation_to_scalar): Likewise.
	(simplify_transformation_to_array): Likewise.
	(simplify_bound): Likewise.
	(simplify_matmul): Likewise.
	(gfc_simplify_pack): Likewise.
	(simplify_minval_maxval): Likewise.
	(gfc_simplify_reshape): Likewise.
	(gfc_simplify_shape): Likewise.
	(gfc_simplify_spread): Likewise.
	(gfc_simplify_transpose): Likewise.
	(gfc_simplify_unpack): Likewise.q
	(gfc_convert_constant): Likewise.
	(gfc_convert_char_constant): Likewise.
	* target-memory.c (encode_derived): Likewise.
	(interpret_array): Likewise.
	(gfc_interpret_derived): Likewise.
	(expr_to_char): Likewise.
	(gfc_merge_initializers): Likewise.
	* trans-array.c (gfc_get_array_constructor_size): Likewise.
	(gfc_trans_array_constructor_value): Likewise.
	(get_array_ctor_strlen): Likewise.
	(gfc_constant_array_constructor_p): Likewise.
	(gfc_build_constant_array_constructor): Likewise.
	(gfc_conv_array_initializer): Likewise.
	* trans-decl.c (check_constant_initializer): Likewise.
	* tarns-expr.c (flatten_array_ctors_without_strlen): Likewise.
	(gfc_apply_interface_mapping_to_cons): Likewise.
	(gfc_trans_structure_assign): Likewise.
	(gfc_conv_structure): Likewise.
	* array.c (check_duplicate_iterator): Likewise.
	(match_array_list): Likewise.
	(match_array_cons_element): Likewise.
	(gfc_match_array_constructor): Likewise.
	(check_constructor_type): Likewise.
	(check_constructor): Likewise.
	(expand): Likewise.
	(expand_constructor): Likewise.
	(extract_element): Likewise.
	(gfc_expanded_ac): Likewise.
	(resolve_array_list): Likewise.
	(gfc_resolve_character_array_constructor): Likewise.
	(gfc_append_constructor): Removed.
	(gfc_insert_constructor): Removed unused function.
	* gfortran.h (gfc_insert_constructor): Removed.
	(gfc_append_constructor): Removed.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: constructor-2.diff
Type: text/x-patch
Size: 81427 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20091224/3105ddaf/attachment.bin>


More information about the Fortran mailing list