Re : [gimple] temporary variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thank you for your answar Ian.

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.

Asma



----- Message d'origine ----
De : Ian Lance Taylor <iant@xxxxxxxxxx>
À : charfi asma <charfiasma@xxxxxxxx>
Cc : gcc-help@xxxxxxxxxxx
Envoyé le : Mar 27 avril 2010, 17 h 06 min 37 s
Objet : Re: [gimple] temporary variable

charfi asma <charfiasma@xxxxxxxx> writes:

> when generating gimple using gcc 4.4.2 from 
>
> int a =5;
> int b=10;
> if (a++ +b != 0)
> return 0;
> else
> return 1;
>
> we obtain this code
>
> int a;
> int b;
> a = 5;
> b = 10;
> D.1715 = a + b;
> retval.0 = D.1715 != 0;
> a = a + 1;
> if (retval.0 != 0) goto <D.1716>; else goto <D.1717>;
> ....
>
> why retval.0 is added ? why we do not produce if (D.1715 !=0) directly ?

For a more precise answer it would help if you give a complete test
case and tell us which dump you are looking at.

In general GIMPLE is generated without optimizations.  The expectation
is that future optimizations will clean up any issues.  In other
words, nobody really pays attentions to details like whether another
variable is introduced early in the process.

Ian






[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux