From fb89e8bd0619dc59d72cc2d4bf7a8b17c699564a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tobias=20Schl=C3=BCter?= Date: Sat, 15 May 2004 01:11:46 +0200 Subject: [PATCH] dump-parse-tree.c (gfc_show_array_ref): Print colon only for ranges when dumping array references. * dump-parse-tree.c (gfc_show_array_ref): Print colon only for ranges when dumping array references. From-SVN: r81866 --- gcc/fortran/ChangeLog | 5 +++++ gcc/fortran/dump-parse-tree.c | 24 +++++++++++++++++------- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 19a66ce588a..312afb34e72 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2004-05-14 Tobias Schlueter + + * dump-parse-tree.c (gfc_show_array_ref): Print colon only + for ranges when dumping array references. + 2004-05-14 Victor Leikehman * decl.c (variable_decl): Always apply default initializer. diff --git a/gcc/fortran/dump-parse-tree.c b/gcc/fortran/dump-parse-tree.c index 31fdf0ba121..5f1db22689b 100644 --- a/gcc/fortran/dump-parse-tree.c +++ b/gcc/fortran/dump-parse-tree.c @@ -183,18 +183,28 @@ gfc_show_array_ref (gfc_array_ref * ar) case AR_SECTION: for (i = 0; i < ar->dimen; i++) { + /* There are two types of array sections: either the + elements are identified by an integer array ('vector'), + or by an index range. In the former case we only have to + print the start expression which contains the vector, in + the latter case we have to print any of lower and upper + bound and the stride, if they're present. */ + if (ar->start[i] != NULL) gfc_show_expr (ar->start[i]); - gfc_status_char (':'); - - if (ar->end[i] != NULL) - gfc_show_expr (ar->end[i]); - - if (ar->stride[i] != NULL) + if (ar->dimen_type[i] == DIMEN_RANGE) { gfc_status_char (':'); - gfc_show_expr (ar->stride[i]); + + if (ar->end[i] != NULL) + gfc_show_expr (ar->end[i]); + + if (ar->stride[i] != NULL) + { + gfc_status_char (':'); + gfc_show_expr (ar->stride[i]); + } } if (i != ar->dimen - 1) -- 2.30.2