[tree-ssa]: Dump file option names and small DCE fix

Diego Novillo dnovillo@redhat.com
Thu Sep 19 06:12:00 GMT 2002


On Wed, 18 Sep 2002, Daniel Berlin wrote:
> >-ftree-ssa		=> Goes away.  Indirectly enabled by the
> >			   other switches.
> >-ftree-ssa-ccp		=> -ftree-ccp
> >-ftree-ssa-dce		=> -ftree-dce
> >-ftree-ssa-pre		=> -ftree-pre
> >
> >Similarly, we drop 'ssa' from the -fdump-tree switches.
> >
> Works for me.
> I'll just modify it as suggested.
> Want me to repost, and let you look at it again, or just commit it?
>
Just commit it and post the patch.  Oh, when I said -ftree-ssa
goes, I meant the switch only.  Maybe we should keep
flag_tree_ssa, which would be set when either of the other
-ftree-XXX are set.  This way we avoid a string of ORs in
c-decl.c

> Sure.  I'll also  remove the change from the patch.
> 
> It's just the example steve posted yesterday:
> int main()
> {
>         int bla, foo, bar;
> 
>         bla = 1;
>         foo = 2*bla;
>         bar = 2*bla+1;
>         goto waffle;
>         return bar;
> waffle:
>         bla = 1;
>         return bar;
> }
> 
> 
> If you *don't* consider the return_stmt's necessary, it transforms it 
> into:
> {
>   int bla;
>   int foo;
>   int bar;
>   int T.1;
>   goto waffle;
>   return bar;
>   waffle:
>   return bar;
> }
> which is wrong anyway (besides the obvious), since the first return is 
> useless.
> 
Ah, I see.  Well, DCE should remove the first return, but not the
second:

{
        int bla, foo, bar;

        bla = 1;
        foo = 2*bla;
        bar = 2*bla+1;
        goto waffle;
waffle:
        return bar;
}

So, if there isn't a V_USE of 'bar' at the second return
statement, then it's a DFA problem.


Diego.



More information about the Gcc-patches mailing list