aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2009-09-01 19:16:46 +0000
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2009-09-01 19:16:46 +0000
commit57efab3db25dd04874903046d1e673cd24377d36 (patch)
tree01f2352f3730ec08a0e21d8a478d579cdf660e84
parentb8992f58187ce0e22774e373bd18e466f551b543 (diff)
* cse.c (cse_extended_basic_block): Use NONDEBUG_INSN_P.var-tracking-assignments-4_4-merge-151281-before
* Makefile.in (TREE_INLINE_H): Take pointer-set.h from GIMPLE_H. * tree-inline.c (remap_gimple_stmt): Use VEC for debug_stmts. (copy_debug_stmt): Likewise. (insert_init_debug_bind): Don't mark symbols for renaming. (optimize_inline_calls): Drop initialization of debug_stmts. Check that it isn't left over. (tree_function_versioning): Likewise. * tree-inline.h: Include gimple.h instead of varray.h and pointer-set.h. (struct copy_body_data): Use VEC for debug_stmts. * cfgexpand.c (expand_gimple_basic_block): Check for debug bind stmts. * var-tracking.c (canonicalize_values_mark): Drop #if 0 block. (canonicalize_values_star): Likewise. (variable_post_merge_new_vals): Likewise. (vt_emit_notes): Move check for empty value_chains into the ENABLE_CHECKING block that ensures it becomes empty. * gimple.h (GIMPLE_DEBUG_BIND): Moved into... (enum gimple_debug_subcode): ... this. New. * tree-flow-inline.h (has_zero_uses, has_single_use, single_imm_use): Simplify inlinable portion. Move larger portion into... * tree-cfg.c (has_zero_uses_1, single_imm_use_1): ... new functions. (verify_gimple_phi): Expand comment. * tree-ssa-loop-ivopts.c (find_interesting_uses): Fix indentation. * tree-ssa.c (target_for_debug_bind): Remove #if 0 block. (propagate_defs_into_debug_stmts): Skip virtual defs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/var-tracking-assignments-4_4-branch@151281 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog.vta32
-rw-r--r--gcc/Makefile.in2
-rw-r--r--gcc/cfgexpand.c4
-rw-r--r--gcc/cse.c3
-rw-r--r--gcc/gimple.h10
-rw-r--r--gcc/tree-cfg.c62
-rw-r--r--gcc/tree-flow-inline.h118
-rw-r--r--gcc/tree-inline.c24
-rw-r--r--gcc/tree-inline.h5
-rw-r--r--gcc/tree-ssa-loop-ivopts.c2
-rw-r--r--gcc/tree-ssa.c8
-rw-r--r--gcc/var-tracking.c106
12 files changed, 181 insertions, 195 deletions
diff --git a/gcc/ChangeLog.vta b/gcc/ChangeLog.vta
index 78d11ba65f4..bb5dd6ded1d 100644
--- a/gcc/ChangeLog.vta
+++ b/gcc/ChangeLog.vta
@@ -1,3 +1,35 @@
+2009-09-01 Alexandre Oliva <aoliva@redhat.com>
+
+ * cse.c (cse_extended_basic_block): Use NONDEBUG_INSN_P.
+ * Makefile.in (TREE_INLINE_H): Take pointer-set.h from GIMPLE_H.
+ * tree-inline.c (remap_gimple_stmt): Use VEC for debug_stmts.
+ (copy_debug_stmt): Likewise.
+ (insert_init_debug_bind): Don't mark symbols for renaming.
+ (optimize_inline_calls): Drop initialization of debug_stmts.
+ Check that it isn't left over.
+ (tree_function_versioning): Likewise.
+ * tree-inline.h: Include gimple.h instead of varray.h and
+ pointer-set.h.
+ (struct copy_body_data): Use VEC for debug_stmts.
+ * cfgexpand.c (expand_gimple_basic_block): Check for debug bind
+ stmts.
+ * var-tracking.c (canonicalize_values_mark): Drop #if 0 block.
+ (canonicalize_values_star): Likewise.
+ (variable_post_merge_new_vals): Likewise.
+ (vt_emit_notes): Move check for empty value_chains into the
+ ENABLE_CHECKING block that ensures it becomes empty.
+ * gimple.h (GIMPLE_DEBUG_BIND): Moved into...
+ (enum gimple_debug_subcode): ... this. New.
+ * tree-flow-inline.h (has_zero_uses, has_single_use,
+ single_imm_use): Simplify inlinable portion. Move larger
+ portion into...
+ * tree-cfg.c (has_zero_uses_1, single_imm_use_1): ... new
+ functions.
+ (verify_gimple_phi): Expand comment.
+ * tree-ssa-loop-ivopts.c (find_interesting_uses): Fix indentation.
+ * tree-ssa.c (target_for_debug_bind): Remove #if 0 block.
+ (propagate_defs_into_debug_stmts): Skip virtual defs.
+
2009-08-21 Alexandre Oliva <aoliva@redhat.com>
* cfgexpand.c: Revert the previous patch, not necessary in 4.4.
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index e637823fb85..ab04045527e 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -872,7 +872,7 @@ SCEV_H = tree-scalar-evolution.h $(GGC_H) tree-chrec.h $(PARAMS_H)
LAMBDA_H = lambda.h $(TREE_H) vec.h $(GGC_H)
TREE_DATA_REF_H = tree-data-ref.h $(LAMBDA_H) omega.h graphds.h tree-chrec.h
VARRAY_H = varray.h $(MACHMODE_H) $(SYSTEM_H) coretypes.h $(TM_H)
-TREE_INLINE_H = tree-inline.h $(VARRAY_H) pointer-set.h
+TREE_INLINE_H = tree-inline.h $(GIMPLE_H)
REAL_H = real.h $(MACHMODE_H)
IRA_INT_H = ira.h ira-int.h $(CFGLOOP_H) alloc-pool.h
DBGCNT_H = dbgcnt.h dbgcnt.def
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 806e1e0f86f..518f729636b 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -2751,7 +2751,7 @@ expand_gimple_basic_block (basic_block bb)
if (new_bb)
return new_bb;
}
- else if (is_gimple_debug (stmt))
+ else if (gimple_debug_bind_p (stmt))
{
location_t sloc = get_curr_insn_source_location ();
tree sblock = get_curr_insn_block ();
@@ -2798,7 +2798,7 @@ expand_gimple_basic_block (basic_block bb)
if (gsi_end_p (nsi))
break;
stmt = gsi_stmt (nsi);
- if (!is_gimple_debug (stmt))
+ if (!gimple_debug_bind_p (stmt))
break;
}
diff --git a/gcc/cse.c b/gcc/cse.c
index 954cb380d00..eafc94bff56 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -6024,8 +6024,7 @@ cse_extended_basic_block (struct cse_basic_block_data *ebb_data)
FIXME: This is a real kludge and needs to be done some other
way. */
- if (INSN_P (insn)
- && !DEBUG_INSN_P (insn)
+ if (NONDEBUG_INSN_P (insn)
&& num_insns++ > PARAM_VALUE (PARAM_MAX_CSE_INSNS))
{
flush_hash_table ();
diff --git a/gcc/gimple.h b/gcc/gimple.h
index ef6e0607faf..bc186f03894 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -110,9 +110,15 @@ enum gf_mask {
GF_OMP_RETURN_NOWAIT = 1 << 0,
GF_OMP_SECTION_LAST = 1 << 0,
- GF_PREDICT_TAKEN = 1 << 15,
+ GF_PREDICT_TAKEN = 1 << 15
+};
- GIMPLE_DEBUG_BIND = 0
+/* Currently, there's only one type of gimple debug stmt. Others are
+ envisioned, for example, to enable the generation of is_stmt notes
+ in line number information, to mark sequence points, etc. This
+ subcode is to be used to tell them apart. */
+enum gimple_debug_subcode {
+ GIMPLE_DEBUG_BIND = 0
};
/* Masks for selecting a pass local flag (PLF) to work on. These
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 0fbecce4c4d..239c03d8e85 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -1255,6 +1255,49 @@ gimple_can_merge_blocks_p (basic_block a, basic_block b)
return true;
}
+/* Return true if the var whose chain of uses starts at PTR has no
+ nondebug uses. */
+bool
+has_zero_uses_1 (const ssa_use_operand_t *head)
+{
+ const ssa_use_operand_t *ptr;
+
+ for (ptr = head->next; ptr != head; ptr = ptr->next)
+ if (!is_gimple_debug (USE_STMT (ptr)))
+ return false;
+
+ return true;
+}
+
+/* Return true if the var whose chain of uses starts at PTR has a
+ single nondebug use. Set USE_P and STMT to that single nondebug
+ use, if so, or to NULL otherwise. */
+bool
+single_imm_use_1 (const ssa_use_operand_t *head,
+ use_operand_p *use_p, gimple *stmt)
+{
+ ssa_use_operand_t *ptr, *single_use = 0;
+
+ for (ptr = head->next; ptr != head; ptr = ptr->next)
+ if (!is_gimple_debug (USE_STMT (ptr)))
+ {
+ if (single_use)
+ {
+ single_use = NULL;
+ break;
+ }
+ single_use = ptr;
+ }
+
+ if (use_p)
+ *use_p = single_use;
+
+ if (stmt)
+ *stmt = single_use ? single_use->loc.stmt : NULL;
+
+ return !!single_use;
+}
+
/* Replaces all uses of NAME by VAL. */
void
@@ -3934,6 +3977,22 @@ verify_gimple_phi (gimple stmt)
}
+/* Verify a gimple debug statement STMT.
+ Returns true if anything is wrong. */
+
+static bool
+verify_gimple_debug (gimple stmt ATTRIBUTE_UNUSED)
+{
+ /* There isn't much that could be wrong in a gimple debug stmt. A
+ gimple debug bind stmt, for example, maps a tree, that's usually
+ a VAR_DECL or a PARM_DECL, but that could also be some scalarized
+ component or member of an aggregate type, to another tree, that
+ can be an arbitrary expression. These stmts expand into debug
+ insns, and are converted to debug notes by var-tracking.c. */
+ return false;
+}
+
+
/* Verify the GIMPLE statement STMT. Returns true if there is an
error, otherwise false. */
@@ -3992,6 +4051,9 @@ verify_types_in_gimple_stmt (gimple stmt)
case GIMPLE_PREDICT:
return false;
+ case GIMPLE_DEBUG:
+ return verify_gimple_debug (stmt);
+
default:
gcc_unreachable ();
}
diff --git a/gcc/tree-flow-inline.h b/gcc/tree-flow-inline.h
index 5ee0e835208..7d280c00cfe 100644
--- a/gcc/tree-flow-inline.h
+++ b/gcc/tree-flow-inline.h
@@ -429,100 +429,88 @@ next_readonly_imm_use (imm_use_iterator *imm)
return imm->imm_use;
}
-/* Return true if VAR has no uses. */
+/* tree-cfg.c */
+extern bool has_zero_uses_1 (const ssa_use_operand_t *head);
+extern bool single_imm_use_1 (const ssa_use_operand_t *head,
+ use_operand_p *use_p, gimple *stmt);
+
+/* Return true if VAR has no nondebug uses. */
static inline bool
has_zero_uses (const_tree var)
{
- const ssa_use_operand_t *ptr, *start;
- bool ret;
+ const ssa_use_operand_t *const ptr = &(SSA_NAME_IMM_USE_NODE (var));
- ptr = &(SSA_NAME_IMM_USE_NODE (var));
- /* A single use means there is no items in the list. */
- ret = (ptr == ptr->next);
+ /* A single use_operand means there is no items in the list. */
+ if (ptr == ptr->next)
+ return true;
- if (ret || !MAY_HAVE_DEBUG_STMTS)
- return ret;
+ /* If there are debug stmts, we have to look at each use and see
+ whether there are any nondebug uses. */
+ if (!MAY_HAVE_DEBUG_STMTS)
+ return false;
- start = ptr;
- for (ptr = start->next; ptr != start; ptr = ptr->next)
- if (!is_gimple_debug (USE_STMT (ptr)))
- return false;
- return true;
+ return has_zero_uses_1 (ptr);
}
-/* Return true if VAR has a single use. */
+/* Return true if VAR has a single nondebug use. */
static inline bool
has_single_use (const_tree var)
{
- const ssa_use_operand_t *ptr, *start;
- bool ret;
+ const ssa_use_operand_t *const ptr = &(SSA_NAME_IMM_USE_NODE (var));
- ptr = &(SSA_NAME_IMM_USE_NODE (var));
- /* A single use means there is one item in the list. */
- ret = (ptr != ptr->next && ptr == ptr->next->next);
+ /* If there aren't any uses whatsoever, we're done. */
+ if (ptr == ptr->next)
+ return false;
- if (ret)
+ /* If there's a single use, check that it's not a debug stmt. */
+ if (ptr == ptr->next->next)
return !is_gimple_debug (USE_STMT (ptr->next));
- else if (!MAY_HAVE_DEBUG_STMTS)
- return ret;
- start = ptr;
- for (ptr = start->next; ptr != start; ptr = ptr->next)
- if (!is_gimple_debug (USE_STMT (ptr)))
- {
- if (ret)
- return false;
- ret = true;
- }
- return ret;
+ /* If there are debug stmts, we have to look at each of them. */
+ if (!MAY_HAVE_DEBUG_STMTS)
+ return false;
+
+ return single_imm_use_1 (ptr, NULL, NULL);
}
-/* If VAR has only a single immediate use, return true, and set USE_P and STMT
- to the use pointer and stmt of occurrence. */
+/* If VAR has only a single immediate nondebug use, return true, and
+ set USE_P and STMT to the use pointer and stmt of occurrence. */
static inline bool
single_imm_use (const_tree var, use_operand_p *use_p, gimple *stmt)
{
- const ssa_use_operand_t *ptr;
- bool ret;
-
- ptr = &(SSA_NAME_IMM_USE_NODE (var));
+ const ssa_use_operand_t *const ptr = &(SSA_NAME_IMM_USE_NODE (var));
- ret = ptr != ptr->next && ptr == ptr->next->next;
-
- if (ret)
- ret = !is_gimple_debug (USE_STMT (ptr->next));
- else if (MAY_HAVE_DEBUG_STMTS)
+ /* If there aren't any uses whatsoever, we're done. */
+ if (ptr == ptr->next)
{
- const ssa_use_operand_t *start = ptr, *prev = ptr, *single_use_prev = 0;
-
- for (ptr = start->next; ptr != start; prev = ptr, ptr = ptr->next)
- if (!is_gimple_debug (USE_STMT (ptr)))
- {
- if (ret)
- {
- ret = false;
- break;
- }
- ret = true;
- single_use_prev = prev;
- }
-
- ptr = single_use_prev;
+ return_false:
+ *use_p = NULL_USE_OPERAND_P;
+ *stmt = NULL;
+ return false;
}
- if (ret)
+ /* If there's a single use, check that it's not a debug stmt. */
+ if (ptr == ptr->next->next)
{
- *use_p = ptr->next;
- *stmt = ptr->next->loc.stmt;
- return true;
+ if (!is_gimple_debug (USE_STMT (ptr->next)))
+ {
+ *use_p = ptr->next;
+ *stmt = ptr->next->loc.stmt;
+ return true;
+ }
+ else
+ goto return_false;
}
- *use_p = NULL_USE_OPERAND_P;
- *stmt = NULL;
- return false;
+
+ /* If there are debug stmts, we have to look at each of them. */
+ if (!MAY_HAVE_DEBUG_STMTS)
+ goto return_false;
+
+ return single_imm_use_1 (ptr, use_p, stmt);
}
-/* Return the number of immediate uses of VAR. */
+/* Return the number of nondebug immediate uses of VAR. */
static inline unsigned int
num_imm_uses (const_tree var)
{
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index a3e83e254f1..236b2a3ff7e 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -1314,7 +1314,7 @@ remap_gimple_stmt (gimple stmt, copy_body_data *id)
copy = gimple_build_debug_bind (gimple_debug_bind_get_var (stmt),
gimple_debug_bind_get_value (stmt),
stmt);
- VARRAY_PUSH_GENERIC_PTR (id->debug_stmts, copy);
+ VEC_safe_push (gimple, heap, id->debug_stmts, copy);
return copy;
}
else
@@ -2065,20 +2065,22 @@ copy_debug_stmt (gimple stmt, copy_body_data *id)
/* Process deferred debug stmts. In order to give values better odds
of being successfully remapped, we delay the processing of debug
- stmts. */
+ stmts until all other stmts that might require remapping are
+ processed. */
static void
copy_debug_stmts (copy_body_data *id)
{
- size_t i, e;
+ size_t i;
+ gimple stmt;
if (!id->debug_stmts)
return;
- for (i = 0, e = VARRAY_ACTIVE_SIZE (id->debug_stmts); i < e; i++)
- copy_debug_stmt ((gimple) VARRAY_GENERIC_PTR (id->debug_stmts, i), id);
+ for (i = 0; VEC_iterate (gimple, id->debug_stmts, i, stmt); i++)
+ copy_debug_stmt (stmt, id);
- VARRAY_POP_ALL (id->debug_stmts);
+ VEC_free (gimple, heap, id->debug_stmts);
}
/* Make a copy of the body of FN so that it can be inserted inline in
@@ -2155,8 +2157,6 @@ insert_init_debug_bind (copy_body_data *id,
gsi_insert_before (&gsi, note, GSI_SAME_STMT);
}
- mark_symbols_for_renaming (note);
-
return note;
}
@@ -3789,8 +3789,6 @@ optimize_inline_calls (tree fn)
id.transform_return_to_modify = true;
id.transform_lang_insert_block = NULL;
id.statements_to_fold = pointer_set_create ();
- if (MAY_HAVE_DEBUG_STMTS)
- VARRAY_GENERIC_PTR_INIT (id.debug_stmts, 8, "debug_stmt");
push_gimplify_context (&gctx);
@@ -3828,6 +3826,8 @@ optimize_inline_calls (tree fn)
fold_marked_statements (last, id.statements_to_fold);
pointer_set_destroy (id.statements_to_fold);
+ gcc_assert (!id.debug_stmts);
+
/* Renumber the (code) basic_blocks consecutively. */
compact_blocks ();
/* Renumber the lexical scoping (non-code) blocks consecutively. */
@@ -4522,9 +4522,6 @@ tree_function_versioning (tree old_decl, tree new_decl, varray_type tree_map,
id.statements_to_fold = pointer_set_create ();
}
- if (MAY_HAVE_DEBUG_STMTS)
- VARRAY_GENERIC_PTR_INIT (id.debug_stmts, 8, "debug_stmt");
-
id.decl_map = pointer_map_create ();
id.debug_map = NULL;
id.src_fn = old_decl;
@@ -4660,6 +4657,7 @@ tree_function_versioning (tree old_decl, tree new_decl, varray_type tree_map,
}
free_dominance_info (CDI_DOMINATORS);
free_dominance_info (CDI_POST_DOMINATORS);
+ gcc_assert (!id.debug_stmts);
VEC_free (gimple, heap, init_stmts);
pop_cfun ();
current_function_decl = old_current_function_decl;
diff --git a/gcc/tree-inline.h b/gcc/tree-inline.h
index 81d3d1f1692..e0cf0021505 100644
--- a/gcc/tree-inline.h
+++ b/gcc/tree-inline.h
@@ -21,8 +21,7 @@ along with GCC; see the file COPYING3. If not see
#ifndef GCC_TREE_INLINE_H
#define GCC_TREE_INLINE_H
-#include "varray.h"
-#include "pointer-set.h"
+#include "gimple.h"
/* Data required for function body duplication. */
@@ -110,7 +109,7 @@ typedef struct copy_body_data
struct basic_block_def *entry_bb;
/* Debug statements that need processing. */
- varray_type debug_stmts;
+ VEC(gimple,heap) *debug_stmts;
/* A map from local declarations in the inlined function to
equivalents in the function into which it is being inlined, where
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index ec987908dc0..2805b66ff10 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -1838,7 +1838,7 @@ find_interesting_uses (struct ivopts_data *data)
find_interesting_uses_stmt (data, gsi_stmt (bsi));
for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi))
if (!is_gimple_debug (gsi_stmt (bsi)))
- find_interesting_uses_stmt (data, gsi_stmt (bsi));
+ find_interesting_uses_stmt (data, gsi_stmt (bsi));
}
if (dump_file && (dump_flags & TDF_DETAILS))
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index ff0c8087c54..0dd80b085ba 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -258,12 +258,6 @@ target_for_debug_bind (tree var)
if (DECL_HAS_VALUE_EXPR_P (var))
return target_for_debug_bind (DECL_VALUE_EXPR (var));
-#if 0
- /* Should we deal with DECL_DEBUG_EXPR_IS_FROM as well? */
- if (DECL_DEBUG_EXPR_IS_FROM (var))
- return target_for_debug_bind (DECL_DEBUG_EXPR (var));
-#endif
-
if (DECL_IGNORED_P (var))
return NULL_TREE;
@@ -435,7 +429,7 @@ propagate_defs_into_debug_stmts (gimple def, basic_block tobb,
if (!MAY_HAVE_DEBUG_STMTS)
return;
- FOR_EACH_SSA_DEF_OPERAND (def_p, def, op_iter, SSA_OP_ALL_DEFS)
+ FOR_EACH_SSA_DEF_OPERAND (def_p, def, op_iter, SSA_OP_DEF)
{
tree var = DEF_FROM_PTR (def_p);
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index 09904a10c91..25bd31b828f 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -2742,25 +2742,8 @@ canonicalize_values_mark (void **slot, void *data)
decl_or_value odv = dv_from_value (node->loc);
void **oslot = shared_hash_find_slot_noinsert (set->vars, odv);
-#if 0 && ENABLE_CHECKING
- variable ovar;
- location_chain onode;
-
- gcc_assert (oslot);
- ovar = (variable)*oslot;
- gcc_assert (ovar->n_var_parts == 1);
- for (onode = ovar->var_part[0].loc_chain; onode;
- onode = onode->next)
- if (onode->loc == val)
- break;
-
- gcc_assert (onode);
-
- /* ??? Remove this in case the assertion above never fails. */
- if (!onode)
-#endif
- oslot = set_slot_part (set, val, oslot, odv, 0,
- node->init, NULL_RTX);
+ oslot = set_slot_part (set, val, oslot, odv, 0,
+ node->init, NULL_RTX);
VALUE_RECURSED_INTO (node->loc) = true;
}
@@ -2971,23 +2954,8 @@ canonicalize_values_star (void **slot, void *data)
}
if (val)
- {
-#if 0 && ENABLE_CHECKING
- variable cvar = (variable)*cslot;
-
- gcc_assert (cvar->n_var_parts == 1);
- for (node = cvar->var_part[0].loc_chain; node; node = node->next)
- if (node->loc == val)
- break;
-
- gcc_assert (node);
-
- /* ??? Remove this in case the assertion above never fails. */
- if (!node)
-#endif
- cslot = set_slot_part (set, val, cslot, cdv, 0,
- VAR_INIT_STATUS_INITIALIZED, NULL_RTX);
- }
+ cslot = set_slot_part (set, val, cslot, cdv, 0,
+ VAR_INIT_STATUS_INITIALIZED, NULL_RTX);
slot = clobber_slot_part (set, cval, slot, 0, NULL);
@@ -3582,65 +3550,6 @@ variable_post_merge_new_vals (void **slot, void *info)
*curp = att->next;
pool_free (attrs_pool, att);
}
-#if 0 /* Don't push constants to values. If you remove this, adjust
- the corresponding comment containing 'push constants to
- values' below. */
- else if (GET_CODE (node->loc) == CONST_INT
- || GET_CODE (node->loc) == CONST_FIXED
- || GET_CODE (node->loc) == CONST_DOUBLE
- || GET_CODE (node->loc) == SYMBOL_REF)
- {
- decl_or_value cdv;
- rtx cval;
- cselib_val *v;
- void **oslot;
-
- if (var->refcount != 1)
- {
- slot = unshare_variable (set, slot, var,
- VAR_INIT_STATUS_INITIALIZED);
- var = (variable)*slot;
- goto restart;
- }
-
- v = cselib_lookup (node->loc,
- TYPE_MODE (TREE_TYPE (dv_as_decl (var->dv))),
- 1);
-
- if (dump_file)
- {
- fprintf (dump_file, "%s new value %i for ",
- cselib_preserved_value_p (v)
- ? "Reused" : "Created", v->value);
- print_rtl_single (dump_file, node->loc);
- fputc ('\n', dump_file);
- }
-
- cselib_preserve_value (v);
- cval = v->val_rtx;
- cdv = dv_from_value (cval);
-
- oslot = shared_hash_find_slot_noinsert (set->vars, cdv);
- if (oslot)
- oslot = set_slot_part (set, node->loc, oslot, cdv, 0,
- VAR_INIT_STATUS_INITIALIZED,
- NULL_RTX);
- else
- {
- if (!*dfpm->permp)
- {
- *dfpm->permp = XNEW (dataflow_set);
- dataflow_set_init (*dfpm->permp);
- }
-
- set_variable_part (*dfpm->permp, node->loc, cdv, 0,
- VAR_INIT_STATUS_INITIALIZED, NULL,
- NO_INSERT);
- }
- node->loc = cval;
- check_dupes = true;
- }
-#endif
}
if (check_dupes)
@@ -7080,14 +6989,13 @@ vt_emit_notes (void)
htab_traverse (shared_hash_htab (cur.vars),
emit_notes_for_differences_1,
shared_hash_htab (empty_shared_hash));
+ if (MAY_HAVE_DEBUG_INSNS)
+ gcc_assert (htab_elements (value_chains) == 0);
#endif
dataflow_set_destroy (&cur);
if (MAY_HAVE_DEBUG_INSNS)
- {
- gcc_assert (htab_elements (value_chains) == 0);
- VEC_free (variable, heap, changed_variables_stack);
- }
+ VEC_free (variable, heap, changed_variables_stack);
emit_notes = false;
}