Show coarrays on parse tree dump, implement debug for array references.

gcc/fortran/ChangeLog:

	* dump-parse-tree.c (show_array_ref): Also show coarrays.
	(debug): Implement for array reference.
This commit is contained in:
Thomas Koenig 2020-12-13 12:54:57 +01:00
parent f1eeabc1fd
commit 501f470267

View File

@ -361,6 +361,31 @@ show_array_ref (gfc_array_ref * ar)
}
fputc (')', dumpfile);
if (ar->codimen == 0)
return;
/* Show coarray part of the reference, if any. */
fputc ('[',dumpfile);
for (i = ar->dimen; i < ar->dimen + ar->codimen; i++)
{
if (ar->dimen_type[i] == DIMEN_STAR)
fputc('*',dumpfile);
else if (ar->dimen_type[i] == DIMEN_THIS_IMAGE)
fputs("THIS_IMAGE", dumpfile);
else
{
show_expr (ar->start[i]);
if (ar->end[i])
{
fputc(':', dumpfile);
show_expr (ar->end[i]);
}
}
if (i != ar->dimen + ar->codimen - 1)
fputs (" , ", dumpfile);
}
fputc (']',dumpfile);
}
@ -3635,3 +3660,14 @@ gfc_dump_global_symbols (FILE *f)
else
gfc_traverse_gsymbol (gfc_gsym_root, show_global_symbol, (void *) f);
}
/* Show an array ref. */
void debug (gfc_array_ref *ar)
{
FILE *tmp = dumpfile;
dumpfile = stderr;
show_array_ref (ar);
fputc ('\n', dumpfile);
dumpfile = tmp;
}