return NULL_TREE;
if (!is_gimple_reg (var))
- return NULL_TREE;
+ {
+ if (is_gimple_reg_type (TREE_TYPE (var))
+ && referenced_var_lookup (cfun, DECL_UID (var)) == NULL_TREE)
+ return var;
+ return NULL_TREE;
+ }
return var;
}
gcc_assert (!need_ssa_update_p (cfun));
- verify_gimple_in_cfg (cfun);
-
timevar_push (TV_TREE_SSA_VERIFY);
/* Keep track of SSA names present in the IL. */
gimple stmt;
TREE_VISITED (name) = 0;
+ verify_ssa_name (name, !is_gimple_reg (name));
+
stmt = SSA_NAME_DEF_STMT (name);
if (!gimple_nop_p (stmt))
{
{
gimple stmt = gsi_stmt (gsi);
use_operand_p use_p;
- bool has_err;
- int count;
- unsigned i;
if (check_modified_stmt && gimple_modified_p (stmt))
{
goto err;
}
- if (is_gimple_assign (stmt)
- && TREE_CODE (gimple_assign_lhs (stmt)) != SSA_NAME)
- {
- tree lhs, base_address;
-
- lhs = gimple_assign_lhs (stmt);
- base_address = get_base_address (lhs);
-
- if (base_address
- && SSA_VAR_P (base_address)
- && !gimple_vdef (stmt)
- && optimize > 0)
- {
- error ("statement makes a memory store, but has no VDEFS");
- print_gimple_stmt (stderr, stmt, 0, TDF_VOPS);
- goto err;
- }
- }
- else if (gimple_debug_bind_p (stmt)
- && !gimple_debug_bind_has_value_p (stmt))
- continue;
-
- /* Verify the single virtual operand and its constraints. */
- has_err = false;
- if (gimple_vdef (stmt))
- {
- if (gimple_vdef_op (stmt) == NULL_DEF_OPERAND_P)
- {
- error ("statement has VDEF operand not in defs list");
- has_err = true;
- }
- if (!gimple_vuse (stmt))
- {
- error ("statement has VDEF but no VUSE operand");
- has_err = true;
- }
- else if (SSA_NAME_VAR (gimple_vdef (stmt))
- != SSA_NAME_VAR (gimple_vuse (stmt)))
- {
- error ("VDEF and VUSE do not use the same symbol");
- has_err = true;
- }
- has_err |= verify_ssa_name (gimple_vdef (stmt), true);
- }
- if (gimple_vuse (stmt))
- {
- if (gimple_vuse_op (stmt) == NULL_USE_OPERAND_P)
- {
- error ("statement has VUSE operand not in uses list");
- has_err = true;
- }
- has_err |= verify_ssa_name (gimple_vuse (stmt), true);
- }
- if (has_err)
+ if (verify_ssa_operands (stmt))
{
- error ("in statement");
- print_gimple_stmt (stderr, stmt, 0, TDF_VOPS|TDF_MEMSYMS);
+ print_gimple_stmt (stderr, stmt, 0, TDF_VOPS);
goto err;
}
- count = 0;
- FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_USE|SSA_OP_DEF)
- {
- if (verify_ssa_name (op, false))
- {
- error ("in statement");
- print_gimple_stmt (stderr, stmt, 0, TDF_VOPS|TDF_MEMSYMS);
- goto err;
- }
- count++;
- }
-
- for (i = 0; i < gimple_num_ops (stmt); i++)
- {
- op = gimple_op (stmt, i);
- if (op && TREE_CODE (op) == SSA_NAME && --count < 0)
- {
- error ("number of operands and imm-links don%'t agree"
- " in statement");
- print_gimple_stmt (stderr, stmt, 0, TDF_VOPS|TDF_MEMSYMS);
- goto err;
- }
- }
+ if (gimple_debug_bind_p (stmt)
+ && !gimple_debug_bind_has_value_p (stmt))
+ continue;
FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_USE|SSA_OP_VUSE)
{
uid_ssaname_map_eq, NULL);
pt_solution_reset (&fn->gimple_df->escaped);
init_ssanames (fn, 0);
- init_phinodes ();
}
+/* Do the actions required to initialize internal data structures used
+ in tree-ssa optimization passes. */
+
+static unsigned int
+execute_init_datastructures (void)
+{
+ /* Allocate hash tables, arrays and other structures. */
+ init_tree_ssa (cfun);
+ return 0;
+}
+
+struct gimple_opt_pass pass_init_datastructures =
+{
+ {
+ GIMPLE_PASS,
+ "*init_datastructures", /* name */
+ NULL, /* gate */
+ execute_init_datastructures, /* execute */
+ NULL, /* sub */
+ NULL, /* next */
+ 0, /* static_pass_number */
+ TV_NONE, /* tv_id */
+ PROP_cfg, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0 /* todo_flags_finish */
+ }
+};
/* Deallocate memory associated with SSA data structures for FNDECL. */
cfun->gimple_df->referenced_vars = NULL;
fini_ssanames ();
- fini_phinodes ();
/* We no longer maintain the SSA operand cache at this point. */
if (ssa_operands_active ())
if (TYPE_ADDR_SPACE (TREE_TYPE (outer_type))
!= TYPE_ADDR_SPACE (TREE_TYPE (inner_type)))
return false;
-
- /* If the outer type is (void *), the conversion is not necessary. */
- if (VOID_TYPE_P (TREE_TYPE (outer_type)))
- return true;
}
/* From now on qualifiers on value types do not matter. */
tree expr, tree var, const char *gmsgid, void *data)
{
gimple context = (gimple) data;
- location_t location;
+ location_t location, cfun_loc;
expanded_location xloc, floc;
if (!ssa_undefined_value_p (t))
location = (context != NULL && gimple_has_location (context))
? gimple_location (context)
: DECL_SOURCE_LOCATION (var);
+ location = linemap_resolve_location (line_table, location,
+ LRK_SPELLING_LOCATION,
+ NULL);
+ cfun_loc = DECL_SOURCE_LOCATION (cfun->decl);
xloc = expand_location (location);
- floc = expand_location (DECL_SOURCE_LOCATION (cfun->decl));
+ floc = expand_location (cfun_loc);
if (warning_at (location, wc, gmsgid, expr))
{
TREE_NO_WARNING (expr) = 1;
if (location == DECL_SOURCE_LOCATION (var))
return;
if (xloc.file != floc.file
- || xloc.line < floc.line
- || xloc.line > LOCATION_LINE (cfun->function_end_locus))
+ || linemap_location_before_p (line_table,
+ location, cfun_loc)
+ || linemap_location_before_p (line_table,
+ cfun->function_end_locus,
+ location))
inform (DECL_SOURCE_LOCATION (var), "%qD was declared here", var);
}
}
a non-register. Otherwise we are confused and forget to
add virtual operands for it. */
&& (!is_gimple_reg_type (TREE_TYPE (var))
+ || TREE_CODE (TREE_TYPE (var)) == VECTOR_TYPE
+ || TREE_CODE (TREE_TYPE (var)) == COMPLEX_TYPE
|| !bitmap_bit_p (not_reg_needs, DECL_UID (var))))
{
TREE_ADDRESSABLE (var) = 0;
if (update_vops)
{
FOR_EACH_BB (bb)
- for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi);)
{
gimple stmt = gsi_stmt (gsi);
if (gimple_assign_lhs (stmt) != lhs)
gimple_assign_set_lhs (stmt, lhs);
+ /* For var ={v} {CLOBBER}; where var lost
+ TREE_ADDRESSABLE just remove the stmt. */
+ if (DECL_P (lhs)
+ && TREE_CLOBBER_P (rhs)
+ && symbol_marked_for_renaming (lhs))
+ {
+ unlink_stmt_vdef (stmt);
+ gsi_remove (&gsi, true);
+ release_defs (stmt);
+ continue;
+ }
+
if (gimple_assign_rhs1 (stmt) != rhs)
{
gimple_stmt_iterator gsi = gsi_for_stmt (stmt);
if (gimple_references_memory_p (stmt)
|| is_gimple_debug (stmt))
update_stmt (stmt);
+
+ gsi_next (&gsi);
}
/* Update SSA form here, we are called as non-pass as well. */