This is the mail archive of the gcc@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: Transforms on SSA form


2008/12/3 James Courtier-Dutton <james.dutton@gmail.com>:

> Example C code:
> a = 1;
> if (condition) a = 2;
> b = a;
>
> In SSA  (use $ for the Phi, Î)
> a1 = 1;
> if (condition) a2 = 2;
> a3 = $(a1, a2);
> b1 = a3;
>
> My problem is how do I convert the "a3 = $(a1, a2);" back to normal C code?

Try using -fdump-tree-ssa and -fdump-tree-optimized to show you both
the SSA and normal form for the program.  If you use mainline GCC you
can get the SSA form of the program even with optimizations turned
off.  For previous releases of GCC you'll need to enable optimizations
to get the SSA form.

The dump output is C-like, but not compilable in general (needs
declarations and some syntax is usually not valid C).


Diego.


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