This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: bad edge created in CFG ?
- From: "Sunzir Deepur" <sunzird at gmail dot com>
- To: "Seongbae Park" <seongbae dot park at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 5 Apr 2007 17:40:52 +0300
- Subject: Re: bad edge created in CFG ?
- References: <b758af9e0703140330l4019e22dwb28aede00f6af9f@mail.gmail.com> <ab3a61990703141031o50d5ee33p1f71925004b139b0@mail.gmail.com>
Hi,
On 3/14/07, Seongbae Park <seongbae.park@gmail.com> wrote:
On 3/14/07, Sunzir Deepur <sunzird@gmail.com> wrote:
> I have used -da and -dv to produce vcg files of the CFG of this simple program:
>
> int main(int argc, char**argv)
> {
> if(argc)
> printf("positive\n");
> else
> printf("zero\n");
>
> return 0;
> }
>
> I have expected to get a CFG as follows:
>
> -----------
> | BB 0 |
> -----------
> / \
> ----------- -----------
> | BB 1 | | BB 2 |
> ----------- -----------
> \ /
> -----------
> | END |
> -----------
>
> But instead, I was surprised to get this CFG:
>
> -----------
> | BB 0 |
> -----------
> / \
> ----------- -----------
> | BB 1 | ------------> | BB 2 |
> ----------- -----------
> \ /
> -----------
> | END |
> -----------
>
> as if one case of the "if" can lead to the other !
>
I don't know what kind of vcg viewer/converter you're using,
but set it to ignore class 3 edges - you'll get what you expected.
I have used an evaluation copy of aiSee viewer (can i use graphviz for
displaying gcc's vcg files ?)
Can you please explain me why has this edge been created ?
What are class 3 edges ? can I prevent them from being created ?
Thank You Very Very Much !!
Sunzir.
--
#pragma ident "Seongbae Park, compiler, http://seongbae.blogspot.com"