aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2020-05-14 16:55:57 +0200
committerAldy Hernandez <aldyh@redhat.com>2020-05-15 08:50:17 +0200
commit8018a7eae5b4888f381758e07521627640ec5932 (patch)
treea7227ed4ef2ea60232e6d0fa4a64c8b36f570830
parentf21c760ce9cba7d478cc7c1e64f2c11cd142a614 (diff)
downloadgcc-8018a7eae5b4888f381758e07521627640ec5932.zip
gcc-8018a7eae5b4888f381758e07521627640ec5932.tar.gz
gcc-8018a7eae5b4888f381758e07521627640ec5932.tar.bz2
Guard indent calculations in trace_ranger by dumping().
This keeps the indentation from going haywire when GORI dumping is turned on and off during a compilation unit.
-rw-r--r--gcc/gimple-ranger.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/gimple-ranger.cc b/gcc/gimple-ranger.cc
index 74cfc67..e72805b 100644
--- a/gcc/gimple-ranger.cc
+++ b/gcc/gimple-ranger.cc
@@ -840,9 +840,9 @@ bool
trace_ranger::trailer (unsigned counter, const char *caller, bool result,
tree name, const irange &r)
{
- indent -= bump;
if (dumping (counter, true))
{
+ indent -= bump;
fputs(result ? "TRUE : " : "FALSE : ", dump_file);
fprintf (dump_file, "(%u) ", counter);
fputs (caller, dump_file);
@@ -857,10 +857,10 @@ trace_ranger::trailer (unsigned counter, const char *caller, bool result,
}
else
fputc('\n', dump_file);
+ // Marks the end of a request.
+ if (indent == 0)
+ fputc('\n', dump_file);
}
- // Marks the end of a request.
- if (indent == 0)
- fputc('\n', dump_file);
return result;
}