summaryrefslogtreecommitdiff
path: root/gcc/caller-save.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2011-03-31 07:28:29 -0600
committerJeff Law <law@gcc.gnu.org>2011-03-31 07:28:29 -0600
commite16b6fd0f7b7da99739f850360d6c86c5b1cba20 (patch)
tree9825cddc84870c8f20906bf543d746a838379d92 /gcc/caller-save.c
parenteb1eb91413b50038212d148bf651c40e4d0e32f9 (diff)
downloadgcc-e16b6fd0f7b7da99739f850360d6c86c5b1cba20.tar.gz
tree-ssa-forwprop.c (forward_propagate_into_cond): Avoid typo potentially leading to null pointer dereference.
* tree-ssa-forwprop.c (forward_propagate_into_cond): Avoid typo potentially leading to null pointer dereference. * caller-save.c (new_saved_hard_reg): Eliminate return value. (setup_save_areas): Corresponding changes to avoid useless assignments. * jump.c (reversed_comparison_code_parts): Avoid successive return statements when REVERSE_CONDITION is defined. * expr.c (expand_assignment): Avoid useless assignments. (expand_expr_real_1): Likewise. (expand_expr_real_2): Avoid useless statements. * tree-ssa-phiopt.c (minmax_replacement): Avoid useless statement. * cfgexpand.c (expand_gimple_basic_block): Avoid useless assignment. * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Avoid useless statements. * stmt.c (expand_expr_stmt): Avoid useless assignment. From-SVN: r171780
Diffstat (limited to 'gcc/caller-save.c')
-rw-r--r--gcc/caller-save.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/gcc/caller-save.c b/gcc/caller-save.c
index 54de30b4a51..369b55c2302 100644
--- a/gcc/caller-save.c
+++ b/gcc/caller-save.c
@@ -82,7 +82,7 @@ static int reg_restore_code (int, enum machine_mode);
struct saved_hard_reg;
static void initiate_saved_hard_regs (void);
-static struct saved_hard_reg *new_saved_hard_reg (int, int);
+static void new_saved_hard_reg (int, int);
static void finish_saved_hard_regs (void);
static int saved_hard_reg_compare_func (const void *, const void *);
@@ -346,7 +346,7 @@ initiate_saved_hard_regs (void)
/* Allocate and return new saved hard register with given REGNO and
CALL_FREQ. */
-static struct saved_hard_reg *
+static void
new_saved_hard_reg (int regno, int call_freq)
{
struct saved_hard_reg *saved_reg;
@@ -359,7 +359,6 @@ new_saved_hard_reg (int regno, int call_freq)
saved_reg->call_freq = call_freq;
saved_reg->first_p = FALSE;
saved_reg->next = -1;
- return saved_reg;
}
/* Free memory allocated for the saved hard registers. */
@@ -463,7 +462,7 @@ setup_save_areas (void)
if (hard_reg_map[regno] != NULL)
hard_reg_map[regno]->call_freq += freq;
else
- saved_reg = new_saved_hard_reg (regno, freq);
+ new_saved_hard_reg (regno, freq);
SET_HARD_REG_BIT (hard_regs_used, regno);
}
/* Look through all live pseudos, mark their hard registers. */
@@ -483,7 +482,7 @@ setup_save_areas (void)
if (hard_reg_map[r] != NULL)
hard_reg_map[r]->call_freq += freq;
else
- saved_reg = new_saved_hard_reg (r, freq);
+ new_saved_hard_reg (r, freq);
SET_HARD_REG_BIT (hard_regs_to_save, r);
SET_HARD_REG_BIT (hard_regs_used, r);
}