This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Tr : [redundency elimination, code motion, commun expression elimination] GCC optimizations
- From: Ian Lance Taylor <iant at google dot com>
- To: charfi asma <charfiasma at yahoo dot fr>
- Cc: "gcc-help\ at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Thu, 22 Sep 2011 13:50:37 -0700
- Subject: Re: Tr : [redundency elimination, code motion, commun expression elimination] GCC optimizations
- References: <1316712613.83211.YahooMailNeo@web28503.mail.ukl.yahoo.com> <1316721552.42227.YahooMailNeo@web28508.mail.ukl.yahoo.com>
charfi asma <charfiasma@yahoo.fr> 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