summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog12
-rw-r--r--gcc/cfglayout.c11
-rw-r--r--gcc/tree-ssa-copy.c1
-rw-r--r--gcc/tree-ssa-live.c9
4 files changed, 22 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 64e26a09d55..c8b1c7d7824 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,15 @@
+2011-03-24 Jeff Law <law@redhat.com>
+
+ * tree-ssa-live.c (remove_unused_scope_block_p): Remove set but
+ unused variable "ann".
+ (remove_unused_locals): Likewise.
+
+ * tree-ssa-copy.c (propagate_tree_value_into_stmt): Remove useless
+ statement.
+
+ * cfglayout.c (fixup_reorder_chain): Do not dereference E_FALL
+ after it is freed.
+
2011-03-24 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* config/s390/s390.c (s390_preferred_reload_class): Return NO_REGS
diff --git a/gcc/cfglayout.c b/gcc/cfglayout.c
index 76925a519f2..05aed221f0b 100644
--- a/gcc/cfglayout.c
+++ b/gcc/cfglayout.c
@@ -766,7 +766,7 @@ fixup_reorder_chain (void)
{
edge e_fall, e_taken, e;
rtx bb_end_insn;
- basic_block nb;
+ basic_block nb, src_bb;
edge_iterator ei;
if (EDGE_COUNT (bb->succs) == 0)
@@ -894,7 +894,10 @@ fixup_reorder_chain (void)
continue;
}
- /* We got here if we need to add a new jump insn. */
+ /* We got here if we need to add a new jump insn.
+ Note force_nonfallthru can delete E_FALL and thus we have to
+ save E_FALL->src prior to the call to force_nonfallthru. */
+ src_bb = e_fall->src;
nb = force_nonfallthru (e_fall);
if (nb)
{
@@ -905,9 +908,9 @@ fixup_reorder_chain (void)
bb = nb;
/* Make sure new bb is tagged for correct section (same as
- fall-thru source, since you cannot fall-throu across
+ fall-thru source, since you cannot fall-thru across
section boundaries). */
- BB_COPY_PARTITION (e_fall->src, single_pred (bb));
+ BB_COPY_PARTITION (src_bb, single_pred (bb));
if (flag_reorder_blocks_and_partition
&& targetm.have_named_sections
&& JUMP_P (BB_END (bb))
diff --git a/gcc/tree-ssa-copy.c b/gcc/tree-ssa-copy.c
index 88972750b04..8062c033697 100644
--- a/gcc/tree-ssa-copy.c
+++ b/gcc/tree-ssa-copy.c
@@ -244,7 +244,6 @@ propagate_tree_value_into_stmt (gimple_stmt_iterator *gsi, tree val)
expr = gimple_assign_rhs1 (stmt);
propagate_tree_value (&expr, val);
gimple_assign_set_rhs_from_tree (gsi, expr);
- stmt = gsi_stmt (*gsi);
}
else if (gimple_code (stmt) == GIMPLE_COND)
{
diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c
index 0441df67b64..c99d987b6b6 100644
--- a/gcc/tree-ssa-live.c
+++ b/gcc/tree-ssa-live.c
@@ -427,7 +427,6 @@ remove_unused_scope_block_p (tree scope)
{
tree *t, *next;
bool unused = !TREE_USED (scope);
- var_ann_t ann;
int nsubblocks = 0;
for (t = &BLOCK_VARS (scope); *t; t = next)
@@ -467,8 +466,7 @@ remove_unused_scope_block_p (tree scope)
info about optimized-out variables in the scope blocks.
Exception are the scope blocks not containing any instructions
at all so user can't get into the scopes at first place. */
- else if ((ann = var_ann (*t)) != NULL
- && is_used_p (*t))
+ else if (var_ann (*t) != NULL && is_used_p (*t))
unused = false;
else if (TREE_CODE (*t) == LABEL_DECL && TREE_USED (*t))
/* For labels that are still used in the IL, the decision to
@@ -690,7 +688,6 @@ remove_unused_locals (void)
basic_block bb;
tree var, t;
referenced_var_iterator rvi;
- var_ann_t ann;
bitmap global_unused_vars = NULL;
unsigned srcidx, dstidx, num;
@@ -766,7 +763,7 @@ remove_unused_locals (void)
{
var = VEC_index (tree, cfun->local_decls, srcidx);
if (TREE_CODE (var) != FUNCTION_DECL
- && (!(ann = var_ann (var))
+ && (!var_ann (var)
|| !is_used_p (var)))
{
if (is_global_var (var))
@@ -798,7 +795,7 @@ remove_unused_locals (void)
FOR_EACH_LOCAL_DECL (cfun, ix, var)
if (TREE_CODE (var) == VAR_DECL
&& is_global_var (var)
- && (ann = var_ann (var)) != NULL
+ && var_ann (var) != NULL
&& is_used_p (var))
mark_all_vars_used (&DECL_INITIAL (var), global_unused_vars);