This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Copy assignments for non scalar types
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Sebastian Pop <sebpop at gmail dot com>
- Cc: gcc at gcc dot gnu dot org, Richard Guenther <rguenther at suse dot de>, Diego Novillo <dnovillo at google dot com>
- Date: Tue, 13 Apr 2010 21:42:55 +0200
- Subject: Re: Copy assignments for non scalar types
- References: <y2qcb9d34b21004131114h70237e6cj24e7a5c529d584d1@mail.gmail.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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