public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Copy assignments for non scalar types
@ 2010-04-13 19:16 Sebastian Pop
  2010-04-13 19:43 ` Jakub Jelinek
  2010-04-13 19:47 ` Sebastian Pop
  0 siblings, 2 replies; 11+ messages in thread
From: Sebastian Pop @ 2010-04-13 19:16 UTC (permalink / raw)
  To: gcc, Richard Guenther, Diego Novillo

Hi,

While working on the tree-if-conv.c, I realized that the copy
of the contents of a non scalar variable are not correctly done.
The copy assignment triggers this error:

error: virtual SSA name for non-VOP decl
while verifying SSA_NAME _ifc_.2005_46 in statement
# .MEM_394 = VDEF <.MEM_475>
    _ifc_.2005_46 = ops[j_457];

The array reference looks like this:

 <array_ref 0x7ffff4bd65a0
    type <record_type 0x7ffff4ee2c78 simplify_plus_minus_op_data
sizes-gimplified asm_written type_0 BLK

For scalar types, the code that creates the copy is working correctly:

/* 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?

Thanks,
Sebastian Pop
--
AMD / Open Source Compiler Engineering / GNU Tools

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-04-14 12:01 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-13 19:16 Copy assignments for non scalar types Sebastian Pop
2010-04-13 19:43 ` Jakub Jelinek
2010-04-13 20:19   ` Sebastian Pop
2010-04-13 20:52   ` Eric Botcazou
2010-04-13 19:47 ` Sebastian Pop
2010-04-14  9:29   ` Richard Guenther
2010-04-14 11:12     ` Diego Novillo
2010-04-14 11:44       ` Richard Guenther
2010-04-14 11:45         ` Martin Jambor
2010-04-14 12:12           ` Richard Guenther
2010-04-14 12:01         ` Diego Novillo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).