Commit b4838d29 by Zdenek Dvorak Committed by Zdenek Dvorak

trans-types.c (gfc_array_range_type): New variable.

	* trans-types.c (gfc_array_range_type): New variable.
	(gfc_init_types): Initialize gfc_array_range_type.
	(gfc_get_array_type_bounds): Use gfc_array_range_type.

From-SVN: r99854
parent d7bf3bcf
2005-05-17 Zdenek Dvorak <dvorakz@suse.cz>
* trans-types.c (gfc_array_range_type): New variable.
(gfc_init_types): Initialize gfc_array_range_type.
(gfc_get_array_type_bounds): Use gfc_array_range_type.
2005-05-17 Jakub Jelinek <jakub@redhat.com> 2005-05-17 Jakub Jelinek <jakub@redhat.com>
PR fortran/15080 PR fortran/15080
......
...@@ -50,6 +50,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -50,6 +50,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
static tree gfc_get_derived_type (gfc_symbol * derived); static tree gfc_get_derived_type (gfc_symbol * derived);
tree gfc_array_index_type; tree gfc_array_index_type;
tree gfc_array_range_type;
tree pvoid_type_node; tree pvoid_type_node;
tree ppvoid_type_node; tree ppvoid_type_node;
tree pchar_type_node; tree pchar_type_node;
...@@ -528,6 +529,12 @@ gfc_init_types (void) ...@@ -528,6 +529,12 @@ gfc_init_types (void)
pchar_type_node = build_pointer_type (gfc_character1_type_node); pchar_type_node = build_pointer_type (gfc_character1_type_node);
gfc_array_index_type = gfc_get_int_type (gfc_index_integer_kind); gfc_array_index_type = gfc_get_int_type (gfc_index_integer_kind);
/* We cannot use gfc_index_zero_node in definition of gfc_array_range_type,
since this function is called before gfc_init_constants. */
gfc_array_range_type
= build_range_type (gfc_array_index_type,
build_int_cst (gfc_array_index_type, 0),
NULL_TREE);
/* The maximum array element size that can be handled is determined /* The maximum array element size that can be handled is determined
by the number of bits available to store this field in the array by the number of bits available to store this field in the array
...@@ -1182,9 +1189,7 @@ gfc_get_array_type_bounds (tree etype, int dimen, tree * lbound, ...@@ -1182,9 +1189,7 @@ gfc_get_array_type_bounds (tree etype, int dimen, tree * lbound,
/* We define data as an unknown size array. Much better than doing /* We define data as an unknown size array. Much better than doing
pointer arithmetic. */ pointer arithmetic. */
arraytype = arraytype =
build_array_type (etype, build_array_type (etype, gfc_array_range_type);
build_range_type (gfc_array_index_type,
gfc_index_zero_node, NULL_TREE));
arraytype = build_pointer_type (arraytype); arraytype = build_pointer_type (arraytype);
GFC_TYPE_ARRAY_DATAPTR_TYPE (fat_type) = arraytype; GFC_TYPE_ARRAY_DATAPTR_TYPE (fat_type) = arraytype;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment