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: [tuples] fix and enable forward propagation


> > Huh.  That's a bug then.
> >
> >> The code below fixes it so
> >> tuples behave like trunk, thus avoiding a stage2 bootstrap problem.
> >
> > I'll see if I can reproduce this on the mainline.
> 
> I can.  It's actually simple - we propagate loads.  So the following should
> fix it:

Ah!  Good, then I wasn't nuts.  I couldn't figure out for the life of me
what trunk was trying to do.  Glad to know it was a bug :).

> Index: tree-ssa-forwprop.c
> ===================================================================
> *** tree-ssa-forwprop.c (revision 137345)
> --- tree-ssa-forwprop.c (working copy)
> *************** can_propagate_from (gimple def_stmt)
> *** 263,269 ****
>       return false;
> 
>     /* If the rhs is a load we cannot propagate from it.  */
> !   if (TREE_CODE_CLASS (gimple_assign_rhs_code (def_stmt)) == tcc_reference)
>       return false;
> 
>     /* Constants can be always propagated.  */
> --- 263,270 ----
>       return false;
> 
>     /* If the rhs is a load we cannot propagate from it.  */
> !   if (TREE_CODE_CLASS (gimple_assign_rhs_code (def_stmt)) == tcc_reference
> !       || TREE_CODE_CLASS (gimple_assign_rhs_code (def_stmt)) ==
> tcc_declaration)
>       return false;
> 
>     /* Constants can be always propagated.  */

I'll test and commit this.  I assume you'll take care of mainline.

Thanks.


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