[Bug tree-optimization/70221] New: graph dump flag used for constraint graph in points-to analysis
vries at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Mar 14 09:15:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70221
Bug ID: 70221
Summary: graph dump flag used for constraint graph in points-to
analysis
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Severity: trivial
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: vries at gcc dot gnu.org
Target Milestone: ---
At the documentation for 'fdump-tree-switch' here
(https://gcc.gnu.org/onlinedocs/gcc/Developer-Options.html ) we read:
...
‘graph’
For each of the other indicated dump files (-fdump-rtl-pass), dump a
representation of the control flow graph suitable for viewing with GraphViz to
file.passid.pass.dot. Each function in the file is pretty-printed as a
subgraph, so that GraphViz can render them all in a single plot.
This option currently only works for RTL dumps, and the RTL is always
dumped in slim form.
...
However, also tree-ssa-structalias.c uses TDF_GRAPH, to decide whether to dump
various constraint graphs:
...
$ grep -d skip TDF_GRAPH gcc/* | grep -v ChangeLog
gcc/dumpfile.c: {"graph", TDF_GRAPH},
gcc/dumpfile.c: | TDF_STMTADDR | TDF_GRAPH | TDF_DIAGNOSTIC | TDF_VERBOSE
gcc/dumpfile.h:#define TDF_GRAPH (1 << 13) /* a graph dump is
being emitted */
gcc/passes.c: && (dfi->pflags & TDF_GRAPH) != 0
gcc/passes.c: && (dump_flags & TDF_GRAPH))
gcc/passes.c: && dump_file && (dump_flags & TDF_GRAPH)
gcc/tree-ssa-structalias.c: if (dump_file && (dump_flags & TDF_GRAPH))
gcc/tree-ssa-structalias.c: if (dump_file && (dump_flags & TDF_GRAPH))
gcc/tree-ssa-structalias.c: if (dump_file && (dump_flags & TDF_GRAPH))
...
These constraint graphs are dump into the normal dump file, and can be
extracted with scripts like this:
...
$ cat split.sh
#!/bin/sh
file="test.c.079i.pta2"
cat "$file" | awk -f split.awk
$ cat split.awk
BEGIN {
n=0
outfile=sprintf("file%02d.dot",n)
doprint=0
}
/^\/\/ The constraint graph/{
doprint=1
}
{
if (doprint)
print > outfile
}
/^}/{
n=n+1
outfile=sprintf("file%02d.dot",n)
doprint=0
}
...
It would be good if the graphs were emitted into separate file(s).
And the constraint graph does not match the description of the 'graph' flag
semantics, so it's probably better to have it triggered by something else, say
TDF_DETAILS.
More information about the Gcc-bugs
mailing list