This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [tree-ssa] cfg_remove_useless_stmts


> > 
> > Can't this be told to tree-ssa-dom.c CSE instead of doing it so late?  Or
> > are we doing it on both sides? 
> 
> The problem is that this fixes up things that are created by un-ssa
> pass.  Concretely consider
> 
> if (s == 0)
>   s = 1;
> 
> This becomes
> 
> if (s_1 == 0)
>   s_2 = 1
> s_3 = phi (s_2, s_1)
> 
> Constant propagation creates
> 
> if (s_1 == 0)
>   ;
> s_3 = phi (1, 0)
> 
> Un-ssa makes
> 
> if (s == 0)
>   s = 1;
> else
>  s = 0;
> 
> from it.

I see... no direct ideas how to deal it more generally then.
> > THis can be executed only for COND_EXPRs where both arms get nullified,
> > right? This should be cared of by cfg_cleanup unless something is wrong
> > with it.
> 
> Yes it could; no it is not, since cfg_cleanup is not run after un-ssa.

It would be nice to unify these two somehow.  I will try to look into it
later.  Some of the issues should be dealt with if we get rid of GOTOs
completely that should not take that long anyway.
Thanks.
Honza
> 
> Zdenek


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]