diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/trans-types.c | 11 |
2 files changed, 14 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index c83763a505f..6e0a73b5d59 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +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> PR fortran/15080 diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c index 44f19f486cc..a70784cbf3c 100644 --- a/gcc/fortran/trans-types.c +++ b/gcc/fortran/trans-types.c @@ -50,6 +50,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA static tree gfc_get_derived_type (gfc_symbol * derived); tree gfc_array_index_type; +tree gfc_array_range_type; tree pvoid_type_node; tree ppvoid_type_node; tree pchar_type_node; @@ -528,6 +529,12 @@ gfc_init_types (void) pchar_type_node = build_pointer_type (gfc_character1_type_node); 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 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, /* We define data as an unknown size array. Much better than doing pointer arithmetic. */ arraytype = - build_array_type (etype, - build_range_type (gfc_array_index_type, - gfc_index_zero_node, NULL_TREE)); + build_array_type (etype, gfc_array_range_type); arraytype = build_pointer_type (arraytype); GFC_TYPE_ARRAY_DATAPTR_TYPE (fat_type) = arraytype; |