aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <aldot@gcc.gnu.org>2023-05-09 17:21:16 +0200
committerBernhard Reutner-Fischer <aldot@gcc.gnu.org>2023-05-10 21:07:57 +0200
commit39f7c0963a9c009e6c9b98e95dbba31cccb07329 (patch)
tree6f6acf21d86015f5813d2ebb01c475459aabc732
parente91937e9a480b8a765ba26865eb000b8e6aa1fce (diff)
downloadgcc-39f7c0963a9c009e6c9b98e95dbba31cccb07329.zip
gcc-39f7c0963a9c009e6c9b98e95dbba31cccb07329.tar.gz
gcc-39f7c0963a9c009e6c9b98e95dbba31cccb07329.tar.bz2
Fortran: dump-parse-tree attribs: fix unbalanced braces [PR109624]
gcc/fortran/ChangeLog: PR fortran/109624 * dump-parse-tree.cc (debug): New function for gfc_namespace. (gfc_debug_code): Delete forward declaration. (show_attr): Make sure to print balanced braces.
-rw-r--r--gcc/fortran/dump-parse-tree.cc16
1 files changed, 13 insertions, 3 deletions
diff --git a/gcc/fortran/dump-parse-tree.cc b/gcc/fortran/dump-parse-tree.cc
index 1fc1f31..2380fa0 100644
--- a/gcc/fortran/dump-parse-tree.cc
+++ b/gcc/fortran/dump-parse-tree.cc
@@ -126,6 +126,16 @@ void debug (gfc_ref *p)
}
void
+debug (gfc_namespace *ns)
+{
+ FILE *tmp = dumpfile;
+ dumpfile = stderr;
+ show_namespace (ns);
+ fputc ('\n', dumpfile);
+ dumpfile = tmp;
+}
+
+void
gfc_debug_expr (gfc_expr *e)
{
FILE *tmp = dumpfile;
@@ -136,7 +146,6 @@ gfc_debug_expr (gfc_expr *e)
}
/* Allow for dumping of a piece of code in the debugger. */
-void gfc_debug_code (gfc_code *c);
void
gfc_debug_code (gfc_code *c)
@@ -758,12 +767,13 @@ show_expr (gfc_expr *p)
static void
show_attr (symbol_attribute *attr, const char * module)
{
+ fputc ('(', dumpfile);
if (attr->flavor != FL_UNKNOWN)
{
if (attr->flavor == FL_DERIVED && attr->pdt_template)
- fputs (" (PDT-TEMPLATE", dumpfile);
+ fputs ("PDT-TEMPLATE ", dumpfile);
else
- fprintf (dumpfile, "(%s ", gfc_code2string (flavors, attr->flavor));
+ fprintf (dumpfile, "%s ", gfc_code2string (flavors, attr->flavor));
}
if (attr->access != ACCESS_UNKNOWN)
fprintf (dumpfile, "%s ", gfc_code2string (access_types, attr->access));