aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-array.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@gcc.gnu.org>2019-12-06 14:28:59 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2019-12-06 14:28:59 +0100
commit2297a38e0c18eaec95bebf750855fb9a4026ffbf (patch)
treec2251d0b4ef7fd2c4a2eec00fabbc88764257094 /gcc/fortran/trans-array.c
parent6e4d01d61f2bec57a247de1c5ee538f122ec34a8 (diff)
downloadgcc-2297a38e0c18eaec95bebf750855fb9a4026ffbf.zip
gcc-2297a38e0c18eaec95bebf750855fb9a4026ffbf.tar.gz
gcc-2297a38e0c18eaec95bebf750855fb9a4026ffbf.tar.bz2
re PR fortran/92775 (Incorrect expression in DW_AT_byte_stride on an array)
PR fortran/92775 * trans.h (struct lang_type, struct lang_decl): Remove span member. (GFC_DECL_SPAN, GFC_TYPE_ARRAY_SPAN): Remove macros. * trans-array.h (gfc_get_descriptor_offsets_for_info): Add another argument. * trans-array.c (gfc_get_descriptor_offsets_for_info): Add SPAN_OFF argument and initialize *SPAN_OFF to the offset of span field. * trans-types.c (gfc_get_array_descr_info): Adjust gfc_get_descriptor_offsets_for_info caller. Compute elem_size as base->span instead of TYPE_SIZE_UNIT (etype) constant. From-SVN: r279045
Diffstat (limited to 'gcc/fortran/trans-array.c')
-rw-r--r--gcc/fortran/trans-array.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 685f8c5..452b494 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -540,9 +540,10 @@ gfc_conv_shift_descriptor_lbound (stmtblock_t* block, tree desc,
void
gfc_get_descriptor_offsets_for_info (const_tree desc_type, tree *data_off,
- tree *dtype_off, tree *dim_off,
- tree *dim_size, tree *stride_suboff,
- tree *lower_suboff, tree *upper_suboff)
+ tree *dtype_off, tree *span_off,
+ tree *dim_off, tree *dim_size,
+ tree *stride_suboff, tree *lower_suboff,
+ tree *upper_suboff)
{
tree field;
tree type;
@@ -552,6 +553,8 @@ gfc_get_descriptor_offsets_for_info (const_tree desc_type, tree *data_off,
*data_off = byte_position (field);
field = gfc_advance_chain (TYPE_FIELDS (type), DTYPE_FIELD);
*dtype_off = byte_position (field);
+ field = gfc_advance_chain (TYPE_FIELDS (type), SPAN_FIELD);
+ *span_off = byte_position (field);
field = gfc_advance_chain (TYPE_FIELDS (type), DIMENSION_FIELD);
*dim_off = byte_position (field);
type = TREE_TYPE (TREE_TYPE (field));