This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: why basic block 0 and 1 not in output graph


On Mon, Sep 28, 2009 at 11:48 PM, Ian Lance Taylor <iant@google.com> wrote:
> tys lefering <twlevo@gmail.com> writes:
>
>> using gcc-4.3.2 and tested gcc-4.5 development snapshot noticed that using
>> 'gcc -da -dv test.c' to generate vcg graph output files these files do not have
>> "basic block 0" and "basic block 1" in the vcg graph output.
>>
>> is this intended and what exactly represent block 0 and block 1 ?
>
> Basic block 0 is the entry block. ?Basic block 1 is the exit block.
> Neither block contains any statements. ?gcc used to use -1 and -2 for
> these, but that was changed to simplify some data structures.
>
> Ian
>
thanks a lot for this answer. gcc graph output works with xvcg and vcgviewer.

note that vcg has a undocumented status keyword to set the initial
folding status of a graph, maybe usefull for gcc. here is an example:

/* initial folded or unfolded status of subgraphs
* can be set using the status keyword with values
* white (unfolded), grey (folded) or black (folded)
*/
graph:
{
/* this subgraph has status white and is initial unfolded */
graph:
{
title: "first-subgraph\nstatus: white\ninitial unfolded"
status: white
node: { title: "1a" }
node: { title: "1b" }
node: { title: "1c" }
edge: { sourcename: "1a" targetname: "1b" }
edge: { sourcename: "1a" targetname: "1c" }
}
/* this subgraph has status grey and is initial folded */
graph:
{
title: "second-subgraph\nstatus: grey\ninitial folded"
status: grey
node: { title: "2a" }
node: { title: "2b" }
node: { title: "2c" }
edge: { sourcename: "2a" targetname: "2b" }
edge: { sourcename: "2a" targetname: "2c" }
}
/* this subgraph has status black and is initial folded */
graph:
{
title: "third-subgraph\nstatus: black\ninitial folded"
status: black
node: { title: "3a" }
node: { title: "3b" }
node: { title: "3c" }
edge: { sourcename: "3a" targetname: "3b" }
edge: { sourcename: "3a" targetname: "3c" }
}
}

thanks, tys


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]