From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113999 invoked by alias); 4 Oct 2016 09:17:33 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 113988 invoked by uid 89); 4 Oct 2016 09:17:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=survive, COST, 2016-10-04 X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 04 Oct 2016 09:17:01 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 0E52FAC93; Tue, 4 Oct 2016 09:16:58 +0000 (UTC) To: GCC Patches Cc: Martin Sebor , Jakub Jelinek From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Subject: [PATCH] Fix warnings for profiledbootstrap (PR bootstrap/77788) Message-ID: Date: Tue, 04 Oct 2016 09:17:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------A7E8484F9266EC60F2E80811" X-IsSubscribed: yes X-SW-Source: 2016-10/txt/msg00133.txt.bz2 This is a multi-part message in MIME format. --------------A7E8484F9266EC60F2E80811 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-length: 209 Hello. In the attached patch I resolve couple of warnings seen during make profiledbootstrap. I can survive bootstrap on both ppc64le-redhat-linux and x86_64-linux-gnu targets. Ready to be installed? Martin --------------A7E8484F9266EC60F2E80811 Content-Type: text/x-patch; name="0001-Fix-warnings-for-make-profiledbootstrap-PR-bootstrap.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-Fix-warnings-for-make-profiledbootstrap-PR-bootstrap.pa"; filename*1="tch" Content-length: 2847 >From 510ac204f2e448d244c8eec5ab8aeab85f6041a9 Mon Sep 17 00:00:00 2001 From: marxin Date: Mon, 3 Oct 2016 23:17:05 +0200 Subject: [PATCH] Fix warnings for make profiledbootstrap (PR bootstrap/77788) gcc/ChangeLog: 2016-10-04 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. --- gcc/expmed.h | 4 +++- gcc/gimple-ssa-strength-reduction.c | 4 ++-- gcc/input.c | 2 +- gcc/tree-ssa-ccp.c | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/gcc/expmed.h b/gcc/expmed.h index cbceaf1..8d0af3c 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 b49637f..7b14b91 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 67f727e..6131659 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 b6ccb59..3dc9ffa 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; -- 2.9.2 --------------A7E8484F9266EC60F2E80811--