This is the mail archive of the
mailing list for the GCC project.
Re: Question about Gimple FE
- From: Diego Novillo <dnovillo at google dot com>
- To: xue yinsong <xyshh94225 at hotmail dot com>, Richard Biener <richard dot guenther at gmail dot com>
- Cc: GCC Development <gcc at gcc dot gnu dot org>
- Date: Fri, 03 Apr 2015 09:45:54 -0400
- 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> <BLU437-SMTP126C99D3E9C8BD08E2658385F10 at phx dot gbl>
On 04/02/15 11:59, xue yinsong wrote:
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.
Not quite. The output of the debug dumpers is not really meant to be fed
back to the compiler. They are debug dumps only. They do not contain
enough information for code generation or analysis.
Gimple needs a text form that can be manually or automatically
generated. This form needs to represent the complete state of the IL
needed to continue codegen/analysis/optimization.
Ideally, one would be able to generate gimple at any arbitrary point in
the compilation pipeline, and also inject gimple at any arbitrary point.
This way, we can generate tests that exercise exactly one pass in the
compiler (which means, it should be able to execute exactly one analysis
or transformation pass, but that's another issue).
Whether the debug dumpers end up using the gimple generation routines is
another question. I think in the long term, it will make sense to have
the debug dumpers generate output in the same syntax expected by the
gimple parser, however.