This is the mail archive of the gcc@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: Copy assignments for non scalar types


On Tue, Apr 13, 2010 at 01:14:11PM -0500, Sebastian Pop wrote:
> /* Create a new temp variable of type TYPE.  Add GIMPLE_ASSIGN to assign EXP
>    to the new variable.  */
> 
> static gimple
> ifc_temp_var (tree type, tree exp)
> {
>   const char *name = "_ifc_";
>   tree var, new_name;
>   gimple stmt;
> 
>   /* Create new temporary variable.  */
>   var = create_tmp_var (type, name);
>   add_referenced_var (var);
> 
>   /* Build new statement to assign EXP to new variable.  */
>   stmt = gimple_build_assign (var, exp);
> 
>   /* Get SSA name for the new variable and set make new statement
>      its definition statement.  */
>   new_name = make_ssa_name (var, stmt);
>   gimple_assign_set_lhs (stmt, new_name);
>   SSA_NAME_DEF_STMT (new_name) = stmt;
>   update_stmt (stmt);
> 
>   return stmt;
> }
> 
> What is missing in this function to make it handle non scalar types?

if (!is_gimple_reg (var))

you shouldn't create SSA name and change the lhs of the stmt.

	Jakub


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