summaryrefslogtreecommitdiffstats
path: root/gcc/fortran/dump-parse-tree.c
diff options
context:
space:
mode:
authortobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-14 23:11:46 +0000
committertobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-14 23:11:46 +0000
commit48bc9f17174c2ecccd002b1c4c50a0e1e4b4b604 (patch)
tree07f4d948652ad0761050ec6b514959c31661dfb7 /gcc/fortran/dump-parse-tree.c
parent8ffad0f932536b558d7cae26b9bfb0b9fe670549 (diff)
downloadppe42-gcc-48bc9f17174c2ecccd002b1c4c50a0e1e4b4b604.tar.gz
ppe42-gcc-48bc9f17174c2ecccd002b1c4c50a0e1e4b4b604.zip
* dump-parse-tree.c (gfc_show_array_ref): Print colon only
for ranges when dumping array references. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@81866 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/dump-parse-tree.c')
-rw-r--r--gcc/fortran/dump-parse-tree.c24
1 files changed, 17 insertions, 7 deletions
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)
OpenPOWER on IntegriCloud