From patchwork Fri Apr 28 13:33:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 756402 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wDvsf1Bp0z9s89 for ; Fri, 28 Apr 2017 23:33:41 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="bFlBC5Hm"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=wQuIo4BPi5QzxDbF5nbeL/ZyhK+cRgvGqQizuPYWNni3F7wvuw mNVe3p+L7Sd3QrZJsQwRFv3EKN8uFRa8qnUJYaT7EoWtHFbhJjKZwbAfuvch9QHr JIIF9UAJPmupTPDg8ZC7zme46mNzjZFqoO+hKOzNpnzvJlsrIeaElGT2U= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=rOxTg/s7wsU8IUv8hWSDQ/LJ9NM=; b=bFlBC5HmZrTx64s+smT6 a+FBtuLEEI2TDTd7VJgzmka4bJrx/VqHqsSN+RGZLGphDoU6HfKdQ+UT/Eegae5R jR97njG4jx0ujZnouM9jiFmsjfWR9rySM/BTal3sR7Zi0Db7ykfVJMEmE5JfTWrx 9ThxgPo3ToRqNmELpgaLCMY= Received: (qmail 93094 invoked by alias); 28 Apr 2017 13:33:29 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 93082 invoked by uid 89); 28 Apr 2017 13:33:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 28 Apr 2017 13:33:27 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 217E77AA9; Fri, 28 Apr 2017 09:33:28 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id avH2iSoZ8mbm; Fri, 28 Apr 2017 09:33:28 -0400 (EDT) Received: from tron.gnat.com (tron.gnat.com [205.232.38.10]) by rock.gnat.com (Postfix) with ESMTP id DF6E77946; Fri, 28 Apr 2017 09:33:26 -0400 (EDT) Received: by tron.gnat.com (Postfix, from userid 4192) id DBBF43B2; Fri, 28 Apr 2017 09:33:26 -0400 (EDT) Date: Fri, 28 Apr 2017 09:33:26 -0400 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [Ada] Fix some warnings in compiler bootstrap Message-ID: <20170428133326.GA7438@adacore.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) This fixes some of the remaining warnings that appear in a compiler bootstrap. The above ones are false positives of -Wmaybe-uninitialized and most are fixed by initializing the variable in case the control flow is fairly complicated; a couple of very local cases are fixed by just adding pragma Warnings. No functional changes. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-04-28 Eric Botcazou * exp_ch9.adb (Build_Lock_Free_Unprotected_Subprogram_Body): Also initialize Block_Decls variable. (Expand_Entry_Barrier): Add pragma Warnings on Func_Body variable. (Build_Dispatching_Requeue): Add pragma Warnings on Op variable. * exp_disp.adb (Expand_Interface_Actuals): Initialize Formal_DDT and Actual_DDT variables. (Expand_Interface_Thunk): Initialize Iface_Formal. (Make_DT): Initialize Size_Comp. (Make_Select_Specific_Data_Table): Initialize Decls. * exp_dist.adb (Add_RACW_Primitive_Declarations_And_Bodies): Also initialize more RPC_Receiver_* variables. (Build_To_Any_Function): Initialize Cstr_Formal. * exp_prag.adb (Expand_Pragma_Contract_Cases): Initialize Msg_Str. Index: exp_prag.adb =================================================================== --- exp_prag.adb (revision 247299) +++ exp_prag.adb (working copy) @@ -1000,7 +1000,7 @@ Flag : Entity_Id; Flag_Decl : Node_Id; If_Stmt : Node_Id; - Msg_Str : Entity_Id; + Msg_Str : Entity_Id := Empty; Multiple_PCs : Boolean; Old_Evals : Node_Id := Empty; Others_Decl : Node_Id; Index: exp_ch9.adb =================================================================== --- exp_ch9.adb (revision 247326) +++ exp_ch9.adb (working copy) @@ -2956,7 +2956,7 @@ Ekind (Corresponding_Spec (N)) = E_Procedure; -- Indicates if N is a protected procedure body - Block_Decls : List_Id; + Block_Decls : List_Id := No_List; Try_Write : Entity_Id; Desired_Comp : Entity_Id; Decl : Node_Id; @@ -6117,6 +6117,7 @@ Cond_Id : Entity_Id; Entry_Body : Node_Id; Func_Body : Node_Id; + pragma Warnings (Off, Func_Body); -- Start of processing for Expand_Entry_Barrier @@ -9985,6 +9986,7 @@ declare Elmt : Elmt_Id; Op : Entity_Id; + pragma Warnings (Off, Op); begin Elmt := First_Elmt (Primitive_Operations (Etype (Conc_Typ))); Index: exp_disp.adb =================================================================== --- exp_disp.adb (revision 247383) +++ exp_disp.adb (working copy) @@ -1546,8 +1546,8 @@ Formal : Entity_Id; Formal_Typ : Entity_Id; Subp : Entity_Id; - Formal_DDT : Entity_Id; - Actual_DDT : Entity_Id; + Formal_DDT : Entity_Id := Empty; -- initialize to prevent warning + Actual_DDT : Entity_Id := Empty; -- initialize to prevent warning begin -- This subprogram is called directly from the semantics, so we need a @@ -1729,7 +1729,7 @@ Expr : Node_Id; Formal : Node_Id; Ftyp : Entity_Id; - Iface_Formal : Node_Id; + Iface_Formal : Node_Id := Empty; -- initialize to prevent warning New_Arg : Node_Id; Offset_To_Top : Node_Id; Target_Formal : Entity_Id; @@ -5274,7 +5274,7 @@ declare Prim_Elmt : Elmt_Id; Prim : Entity_Id; - Size_Comp : Node_Id; + Size_Comp : Node_Id := Empty; begin Prim_Elmt := First_Elmt (Primitive_Operations (Typ)); @@ -6377,7 +6377,7 @@ Loc : constant Source_Ptr := Sloc (Typ); Conc_Typ : Entity_Id; - Decls : List_Id; + Decls : List_Id := No_List; Prim : Entity_Id; Prim_Als : Entity_Id; Prim_Elmt : Elmt_Id; Index: exp_dist.adb =================================================================== --- exp_dist.adb (revision 247293) +++ exp_dist.adb (working copy) @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2016, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2017, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -1364,10 +1364,10 @@ RPC_Receiver : Entity_Id; RPC_Receiver_Statements : List_Id; RPC_Receiver_Case_Alternatives : constant List_Id := New_List; - RPC_Receiver_Elsif_Parts : List_Id; - RPC_Receiver_Request : Entity_Id; - RPC_Receiver_Subp_Id : Entity_Id; - RPC_Receiver_Subp_Index : Entity_Id; + RPC_Receiver_Elsif_Parts : List_Id := No_List; + RPC_Receiver_Request : Entity_Id := Empty; + RPC_Receiver_Subp_Id : Entity_Id := Empty; + RPC_Receiver_Subp_Index : Entity_Id := Empty; Subp_Str : String_Id; @@ -9434,7 +9434,7 @@ Stms : List_Id; Expr_Formal : Entity_Id; - Cstr_Formal : Entity_Id; + Cstr_Formal : Entity_Id := Empty; -- initialize to prevent warning Any : Entity_Id; Result_TC : Node_Id;