From: Martin Liska Date: Thu, 6 Oct 2016 07:33:49 +0000 (+0200) Subject: Fix warnings for make profiledbootstrap (PR bootstrap/77788) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ac2a97db4b862579d6fea2e97000650bfe9b4659;p=gcc.git Fix warnings for make profiledbootstrap (PR bootstrap/77788) PR bootstrap/77788 * expmed.h (mul_highpart_cost_ptr): Add an gcc_assert. * gimple-ssa-strength-reduction.c (slsr_process_cast): Initialize a pointer to NULL. (slsr_process_copy): Likewise. * input.c (location_get_source_line): Likewise. * tree-ssa-ccp.c (optimize_atomic_bit_test_and): Likewise. From-SVN: r240827 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 18020cac141..965f54d9254 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2016-10-06 Martin Liska + + PR bootstrap/77788 + * expmed.h (mul_highpart_cost_ptr): Add an gcc_assert. + * gimple-ssa-strength-reduction.c (slsr_process_cast): + Initialize a pointer to NULL. + (slsr_process_copy): Likewise. + * input.c (location_get_source_line): Likewise. + * tree-ssa-ccp.c (optimize_atomic_bit_test_and): Likewise. + 2016-10-05 Andrew Senkevich * common/config/i386/i386-common.c (OPTION_MASK_ISA_PCOMMIT_UNSET, diff --git a/gcc/expmed.h b/gcc/expmed.h index cbceaf16dff..8d0af3cf2de 100644 --- a/gcc/expmed.h +++ b/gcc/expmed.h @@ -618,8 +618,10 @@ static inline int * mul_highpart_cost_ptr (bool speed, machine_mode mode) { gcc_assert (GET_MODE_CLASS (mode) == MODE_INT); + int m = mode - MIN_MODE_INT; + gcc_assert (m < NUM_MODE_INT); - return &this_target_expmed->x_mul_highpart_cost[speed][mode - MIN_MODE_INT]; + return &this_target_expmed->x_mul_highpart_cost[speed][m]; } /* Set the COST for computing the high part of a multiplication in MODE diff --git a/gcc/gimple-ssa-strength-reduction.c b/gcc/gimple-ssa-strength-reduction.c index b49637f5c79..7b14b91fed4 100644 --- a/gcc/gimple-ssa-strength-reduction.c +++ b/gcc/gimple-ssa-strength-reduction.c @@ -1529,7 +1529,7 @@ static void slsr_process_cast (gimple *gs, tree rhs1, bool speed) { tree lhs, ctype; - slsr_cand_t base_cand, c, c2; + slsr_cand_t base_cand, c = NULL, c2; unsigned savings = 0; if (!legal_cast_p (gs, rhs1)) @@ -1593,7 +1593,7 @@ slsr_process_cast (gimple *gs, tree rhs1, bool speed) static void slsr_process_copy (gimple *gs, tree rhs1, bool speed) { - slsr_cand_t base_cand, c, c2; + slsr_cand_t base_cand, c = NULL, c2; unsigned savings = 0; base_cand = base_cand_from_table (rhs1); diff --git a/gcc/input.c b/gcc/input.c index 67f727e5a2b..61316599cbd 100644 --- a/gcc/input.c +++ b/gcc/input.c @@ -713,7 +713,7 @@ const char * location_get_source_line (const char *file_path, int line, int *line_len) { - char *buffer; + char *buffer = NULL; ssize_t len; if (line == 0) diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index b6ccb59d241..3dc9ffa57d4 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -2817,7 +2817,7 @@ optimize_atomic_bit_test_and (gimple_stmt_iterator *gsip, FOR_EACH_IMM_USE_STMT (g, iter, use_lhs) { enum tree_code code = ERROR_MARK; - tree op0, op1; + tree op0 = NULL_TREE, op1 = NULL_TREE; if (is_gimple_debug (g)) { has_debug_uses = true;