This is the mail archive of the
mailing list for the GCC project.
Re: Question about Gimple FE
- From: xue yinsong <xyshh94225 at hotmail dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: GCC Development <gcc at gcc dot gnu dot org>
- Date: Thu, 2 Apr 2015 23:59:23 +0800
- Subject: Re: Question about Gimple FE
- Authentication-results: sourceware.org; auth=none
- References: <BLU436-SMTP393D735E667D7744698A4D85080 at phx dot gbl> <CAFiYyc0ukmm0w+YPQ1QOV2Vw3euPmVZR2MLHsjc25XB9T0ds8w at mail dot gmail dot com> <BLU436-SMTP23617265C8657F936DF78CF85090 at phx dot gbl> <CAFiYyc3Ryj6mj9o-JeJwfBHfHavQDD-iA_8gW9taoUEehKLWdw at mail dot gmail dot com> <CAFiYyc2eje=Fx5DRRDOktqvv0=MDp8vK54AKvKuwWRbM4u5-DQ at mail dot gmail dot com>
On 15/3/30 äå5:40, "Richard Biener" <email@example.com> wrote:
>On Mon, Mar 30, 2015 at 11:36 AM, Richard Biener
>> On Fri, Mar 27, 2015 at 4:00 PM, xue yinsong <firstname.lastname@example.org> wrote:
>>> Thanks for your reply to my proposal.
>>> AFAIS, most of the files generated by -fdump-tree-all are presented in C-like form instead
>>> of in lisp-like tuple form.
>>> So itâs better to implement a front end for the C-like gimple representations.
>>> I want to make sure if I get the idea right.
>>> Besides, Iâm uncertain about the following questions:
>>> 1.I suppose the syntax of the original gimple file generated by -fdump-tree-gimple would cover
>>> the syntax of those generated in later stages. Could some one tell me if thatâs correct?
>> Well - in 004t.gimple there is still no CFG and we are not in SSA
>> form, so syntax of 'gimple'
>> would change slightly dependent on properties of the IL. GCC goes to
>> various lowering stages
>> (also for things like OpenMP, nested function and exception handling support).
>Btw, I wouldn't necessarily try to parse exactly those dump format -
>streamlining it for
>easier parsing would be ok, especially for the basic-block markers.
>There was a request
>multiple times to make it easier to adjust a function cut&pasted from
>a dump produced
>by -fdump-tree to valid C (thus accepted by gcc). One annoying
>road-block is how we
>dump labels and goto destinations.
I tried to compile some simple programs with -fdump-treep-all and
read some of the dumped files. I have the following comments.
If I said something wrong please correct me.
I suppose our goal is to translate the dumped program back to
the C source code (otherwise we can simply retain the gotos and
labels since they are already `validâ in C). In this case we have to
convert the gotos back to if-elses and whiles. As long as
CFG informations are given, itâs possible to get rid of these gotos.
Apart from this, Gimple and C also have some differences
in PHI nodes and exception handling code. They also need to be
converted back to corresponding C syntax.
>>> 2.On my computer, it seems both -fdump-tree-gimple and -fdump-tree-gimple-raw dump the code to <filename>.004t.gimple.
>>> tf -fdump-tree-all is used, only the result of -fdump-tree-gimple will be presented.
>>> Does gcc behave this way on purpose?
>> I think so. -raw is a dump modifier while -all selects '-gimple' and
>> all others.
>>> Best regards,
>>> Yinsong Xue