+2012-05-29 Richard Guenther <rguenther@suse.de>
+
+ * tree-dfa.c (find_vars_r): Do not call add_referenced_vars
+ for globals.
+ (add_referenced_var_1): Re-organize. Assert we are not
+ called for globals.
+ (remove_referenced_var): Likewise.
+ * varpool.c (add_new_static_var): Use create_tmp_var_raw.
+ * tree-mudflap.c (execute_mudflap_function_ops): Do not
+ call add_referenced_var on globals.
+ * matrix-reorg.c (transform_access_sites): Likewise.
+
2012-05-29 Steven Bosscher <steven@gcc.gnu.org>
* alias.c (reg_known_value): Make this a VEC.
num_elements =
fold_build2 (MULT_EXPR, sizetype, fold_convert (sizetype, acc_info->index),
fold_convert (sizetype, d_size));
- add_referenced_var (d_size);
gsi = gsi_for_stmt (acc_info->stmt);
tmp1 = force_gimple_operand_gsi (&gsi, num_elements, true,
NULL, true, GSI_SAME_STMT);
/* If T is a regular variable that the optimizers are interested
in, add it to the list of variables. */
- else if (SSA_VAR_P (*tp))
+ else if ((TREE_CODE (*tp) == VAR_DECL
+ && !is_global_var (*tp))
+ || TREE_CODE (*tp) == PARM_DECL
+ || TREE_CODE (*tp) == RESULT_DECL)
add_referenced_var_1 (*tp, fn);
/* Type, _DECL and constant nodes have no interesting children.
|| TREE_CODE (var) == PARM_DECL
|| TREE_CODE (var) == RESULT_DECL);
- if (!(TREE_CODE (var) == VAR_DECL
- && VAR_DECL_IS_VIRTUAL_OPERAND (var))
- && is_global_var (var))
- return false;
+ gcc_checking_assert ((TREE_CODE (var) == VAR_DECL
+ && VAR_DECL_IS_VIRTUAL_OPERAND (var))
+ || !is_global_var (var));
- if (!*DECL_VAR_ANN_PTR (var))
- *DECL_VAR_ANN_PTR (var) = ggc_alloc_cleared_var_ann_d ();
-
- /* Insert VAR into the referenced_vars hash table if it isn't present. */
+ /* Insert VAR into the referenced_vars hash table if it isn't present
+ and allocate its var-annotation. */
if (referenced_var_check_and_insert (var, fn))
- return true;
+ {
+ gcc_checking_assert (!*DECL_VAR_ANN_PTR (var));
+ *DECL_VAR_ANN_PTR (var) = ggc_alloc_cleared_var_ann_d ();
+ return true;
+ }
return false;
}
-/* Remove VAR from the list. */
+/* Remove VAR from the list of referenced variables and clear its
+ var-annotation. */
void
remove_referenced_var (tree var)
void **loc;
unsigned int uid = DECL_UID (var);
- /* Preserve var_anns of globals. */
- if (!is_global_var (var)
- && (v_ann = var_ann (var)))
- {
- ggc_free (v_ann);
- *DECL_VAR_ANN_PTR (var) = NULL;
- }
- gcc_assert (DECL_P (var));
+ gcc_checking_assert (TREE_CODE (var) == VAR_DECL
+ || TREE_CODE (var) == PARM_DECL
+ || TREE_CODE (var) == RESULT_DECL);
+
+ gcc_checking_assert (!is_global_var (var));
+
+ v_ann = var_ann (var);
+ ggc_free (v_ann);
+ *DECL_VAR_ANN_PTR (var) = NULL;
+
in.uid = uid;
loc = htab_find_slot_with_hash (gimple_referenced_vars (cfun), &in, uid,
NO_INSERT);