Re: Tr : [redundency elimination, code motion, commun expression elimination] GCC optimizations

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

 



charfi asma <charfiasma@xxxxxxxx> writes:

> If GCC could optimize this code 
>
>
> if (x=1)
> {
> a=b;
> c=d;
> e=f;
> foo();
>
> }
> if (x=2)
> {
> a=b;
> c=d;
> e=f;
> foo();
> }  
>
>
> to this one 
>
>
> if (x=1) || (x=2)
> {
> a=b;
> c=d;
> e=f;
> foo();
> }
>
> it will be implemented in which optimizations ? pre: partiel redundent elimination optimizaion or another one may be code motion ?


I don't think gcc can do that optimization today.  There used be an
optimization -frtl-abstract-sequences which was vaguely similar, but it
didn't work well and was removed.  If this were to be implemented, it
would not be any of the existing optimizations; it would be something
different.

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