diff options
author | Paul Brook <paul@codesourcery.com> | 2004-11-16 02:02:37 +0000 |
---|---|---|
committer | Paul Brook <pbrook@gcc.gnu.org> | 2004-11-16 02:02:37 +0000 |
commit | 40b026d890b797f058047aeba398e22b0e8d7db6 (patch) | |
tree | 0b302faf5d83b8618c58bea7ea7eb3ca99221e10 /gcc/fortran/trans-array.c | |
parent | e61ec2dd124a3ef737fabc2686a862c76bdb91db (diff) | |
download | gcc-40b026d890b797f058047aeba398e22b0e8d7db6.zip gcc-40b026d890b797f058047aeba398e22b0e8d7db6.tar.gz gcc-40b026d890b797f058047aeba398e22b0e8d7db6.tar.bz2 |
re PR fortran/13010 (seg fault on valid code)
PR fortran/13010
* trans-array.c (gfc_trans_allocate_temp_array): Use gfc_get_dtype.
(gfc_array_init_size, gfc_conv_expr_descriptor): Ditto.
* trans-types.c (gfc_get_dtype): Accept array type rather than element
type.
(gfc_get_nodesc_array_type): Don't set GFC_TYPE_ARRAY_DTYPE.
(gfc_get_array_type_bounds): Ditto.
(gfc_get_derived_type): Recurse into derived type pointers.
* trans-types.h (gfc_get_dtype): Add prototype.
* trans.h (GFC_TYPE_ARRAY_DTYPE): Add comment.
testsuite/
* gfortran.dg/der_pointer_1.f90: New test.
From-SVN: r90714
Diffstat (limited to 'gcc/fortran/trans-array.c')
-rw-r--r-- | gcc/fortran/trans-array.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 6380bcf..330c34b 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -569,8 +569,7 @@ gfc_trans_allocate_temp_array (gfc_loopinfo * loop, gfc_ss_info * info, /* Fill in the array dtype. */ tmp = gfc_conv_descriptor_dtype (desc); - gfc_add_modify_expr (&loop->pre, tmp, - GFC_TYPE_ARRAY_DTYPE (TREE_TYPE (desc))); + gfc_add_modify_expr (&loop->pre, tmp, gfc_get_dtype (TREE_TYPE (desc))); /* Fill in the bounds and stride. This is a packed array, so: @@ -2658,8 +2657,7 @@ gfc_array_init_size (tree descriptor, int rank, tree * poffset, /* Set the dtype. */ tmp = gfc_conv_descriptor_dtype (descriptor); - gfc_add_modify_expr (pblock, tmp, - GFC_TYPE_ARRAY_DTYPE (TREE_TYPE (descriptor))); + gfc_add_modify_expr (pblock, tmp, gfc_get_dtype (TREE_TYPE (descriptor))); for (n = 0; n < rank; n++) { @@ -3771,7 +3769,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss) /* Set the dtype. */ tmp = gfc_conv_descriptor_dtype (parm); - gfc_add_modify_expr (&loop.pre, tmp, GFC_TYPE_ARRAY_DTYPE (parmtype)); + gfc_add_modify_expr (&loop.pre, tmp, gfc_get_dtype (parmtype)); if (se->direct_byref) base = gfc_index_zero_node; |