[gfortran] Clean up arrays

Paul Brook paul@codesourcery.com
Sun Apr 4 11:50:00 GMT 2004


The attached patch cleans up how we handle arrays. Instead of playing tricks 
with pointers, we how use the array pointer directly, and explicitly include 
the offset. Multi-dimensional arrays are still lowered into 1-d arrays.

This is basically preperation work for arrays of strings. It should also give 
the vectorizer a better chance of working (I've not tested this though).

Bootstrapped and tested on i686-linux.
Applied to tree-ssa branch.

Paul

2003-04-04  Paul Brook  <paul@codesourcery.com>

	* trans-array.c (OFFSET_FIELD): Rename from BASE_FIELD.
	(gfc_conv_descriptor_base): Rename ...
	(gfc_conv_descriptor_offset): ... to this.
	(gfc_trans_allocate_array_storage): Set offset to zero.
	(gfc_conv_array_base): Rename ...
	(gfc_conv_array_offset): ... to this.
	(gfc_conv_array_index_ref): Add offset parameter.
	(gfc_conv_array_ref): Include offset.
	(gfc_trans_preloop_setup): Use existing offset.
	(gfc_trans_allocate_temp_array,  gfc_array_allocate,
	gfc_trans_auto_array_allocation, gfc_trans_g77_array,
	gfc_trans_dummy_array_bias, gfc_conv_expr_descriptor,
	gfc_conf_ss_descriptor): Set offset.
	* trans-array.h: Rename prototypes.
	* trans-const.h (gfc_index_zero_node): Define.
	* trans-decl.c (gfc_build_qualified_array): Change base to offset.
	* trans-types.c (gfc_get_array_type_bounds): Ditto.
	(gfc_get_nodesc_array_type): Calculate offset before upper bound.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.aoffset
Type: text/x-diff
Size: 18850 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20040404/94c78d4e/attachment.bin>


More information about the Gcc-patches mailing list