[gimple] temporary variable

Ian Lance Taylor iant@google.com
Wed Apr 28 07:35:00 GMT 2010


charfi asma <charfiasma@yahoo.fr> writes:

> I would like to understand the gimplification step in GCC and I heard about unstructured and structured gimple produced from code (gcc summit 2005, gimplification improvment)
> for example, to improve gimplification, Gimple code generated from.
>
> if (a++ +b != 0) return 0; else return 1; 
> should be :
> D.1715 = a + b;
> a = a + 1;
> if (D.1715 != 0) goto <D.1716>; else goto <D.1717>;
>
> and this is not what gcc 4.4 produce (with interval.0...)
>
> I do not think that no body pays attentions to details generated in gimple. 
> I think that each introduced variable should be justified.

I'm fairly sure that the 2005 paper is out of date with respect to
current gcc.

I suppose I would recommend that you examine the gcc source code to
understand where these variables are coming from.  That will give you
an argument for whether the variable is justified or not.

Don't lose sight of the fact that GIMPLE generation should be fast
rather than optimal.  The compiler already has to run a number of
optimization passes which are completely able to remove unnecessary
variables introduced during gimplification.  If it takes time during
gimplification to decide whether or not to introduce a variable, then
it's better to introduce the variable and let the subsequent pass,
which we know we are going to run anyway, clean it up.  Of course, if
the variable can be omitted during gimplification without taking any
time, then that is better still.

Ian



More information about the Gcc-help mailing list