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] Convert tail recursion elimination


Hi,

> > + /* If STMT is a copy or no-op cast statement, returns its rhs operand.
> > +    Otherwise returns NULL.  */
> > +
> > + tree
> > + copy_or_nop_cast_stmt_rhs (gimple stmt)
> > + {
> > +   tree rhs;
> > +
> > +   if (gimple_code (stmt) != GIMPLE_ASSIGN)
> > +     return NULL_TREE;
> > +
> > +   rhs = gimple_assign_rhs1 (stmt);
> > +   if (gimple_assign_copy_p (stmt))
> > +     return rhs;
> > +   if (gimple_assign_cast_p (stmt))
> > +     {
> > +       tree lhs_type = TREE_TYPE (gimple_assign_lhs (stmt));
> > +       tree rhs_type = TREE_TYPE (TREE_TYPE (rhs));
> > +       return TYPE_MODE (lhs_type) == TYPE_MODE (rhs_type) ? rhs : NULL_TREE;
> 
> I don't understand this -- why would we make this distinction for a function
> named copy_or_nop_cast_stmt_rhs?

the condition is copied from STRIP_NOPS.

Zdenek


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