This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tuples] fix and enable forward propagation
On Wed, Jul 2, 2008 at 10:25 AM, Richard Guenther
<richard.guenther@gmail.com> wrote:
> On Wed, Jul 2, 2008 at 1:03 AM, Aldy Hernandez <aldyh@redhat.com> wrote:
>> Hi folks.
>>
>> The code in trunk dealing with abnormal PHI nodes returned false on
>> def_stmt's with only one operand on the RHS.
>
> 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:
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. */
Richard.