This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Bugs in SSA-CCP and SSA-PRE optimizers
- From: Diego Novillo <dnovillo at redhat dot com>
- To: Steven Bosscher <s dot bosscher at student dot tudelft dot nl>
- Cc: Daniel Berlin <dberlin at dberlin dot org>, gcc at gcc dot gnu dot org
- Date: Tue, 17 Sep 2002 16:47:09 -0400
- Subject: Re: Bugs in SSA-CCP and SSA-PRE optimizers
- Organization: Red Hat Canada
- References: <1032292695.730.78.camel@steven>
On Tue, 17 Sep 2002, Steven Bosscher wrote:
> main() main()
> { {
> int bla; int bla;
> int foo; int foo;
> int bar; int bar;
> int T.1; int T.1;
> > int pretmp.2;
> bla = 1; bla = 1;
> foo = bla * 2; | foo = pretmp.2 = 1 * 2;
> T.1 = bla * 2; | T.1 = pretmp.2;
> bar = T.1 + 1; bar = T.1 + 1;
> goto waffle; goto waffle;
> return bar; return bar;
> waffle: waffle:
> bla = 1; bla = 1;
> return bar; return bar;
> } }
>
> Note the redundant assignment to T.1. It seems PRE doesn't kill those
> T.[0-9*] variables (both uses and it declarations). We're generating (a
> lot of?) useless RTL here.
>
The useless assignment to T.1 will not be detected by PRE. You
need copy propagation for that.
> Also, why is "foo = pretmp.2 = 1 * 2" not folded?
>
PRE should be folding expressions. It should also be calling the
simplifier again, from what I can see.
Diego.