From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-x230.google.com (mail-wr0-x230.google.com [IPv6:2a00:1450:400c:c0c::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E749821AE2646 for ; Tue, 20 Jun 2017 05:02:51 -0700 (PDT) Received: by mail-wr0-x230.google.com with SMTP id r103so90650870wrb.0 for ; Tue, 20 Jun 2017 05:04:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=wfQMxuba2/ZGq/AigKAN7A4fqUkZBbOH6ik1ROvd/q8=; b=AeawGhGgholdag7wGo+z9ChC4iidBVBPWrFz+cgwCnafpBz5BUppvdFyIp5TphTIVK EcqIwTM+9uKyOWFxF5jPD/U/nCTOSmBLzv9Ldzkk/0BoK8oSugrMTWG6Rd7UGY8QnZsE 3mZds1yAjFnWdThuaUKDCZKOISE4AYF54ZbXI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=wfQMxuba2/ZGq/AigKAN7A4fqUkZBbOH6ik1ROvd/q8=; b=m3E2+bi4sN/O80dY3fUij3JIv+3M+sx8/FAbs6RMrVs28klrkCt3BVPcnIAcEDdaUo NYo/oVHOE7RaJeBXHV3EFWdYdVqz4ceo79FkbxB6OVZr2FYfxr/VJHg1CxyGlT9UjL0+ Z1Tzu04Y/+YLSHbu3OgEXqFg+GmqgmPngJbeP16CTDor7WVLdcRB8QFo3xoHzmnMQqHP cpp3uYqU2vk/mxR7y2e77iyHd+sLTJTqsXNJicObha0O4A8djnr6FauQ0FPcoLmLyfUP +lCDzlRbG/iBNaE8O/R80ajsaZNTuLfL0tkmNj6sT0nNDI/z2tyAjJ9oOe1/gpgVa+Xh sk4A== X-Gm-Message-State: AKS2vOzCDwgMpTNg0cvrQYcb04DCf9XS5TQ5wMS9CRhVaD99OavKVdAD 1q7dKp3VybBwtVSQ X-Received: by 10.223.151.213 with SMTP id t21mr6590255wrb.20.1497960253172; Tue, 20 Jun 2017 05:04:13 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id k86sm12234275wmi.16.2017.06.20.05.04.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Jun 2017 05:04:12 -0700 (PDT) Date: Tue, 20 Jun 2017 13:04:11 +0100 From: Leif Lindholm To: Ryan Harkin Cc: Ard Biesheuvel , Laszlo Ersek , "edk2-devel@lists.01.org" Message-ID: <20170620120411.GA26676@bivouac.eciton.net> References: <20170620110008.24413-1-leif.lindholm@linaro.org> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [PATCH] ArmPlatformPkg: eliminate Juno gcc build warning X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jun 2017 12:02:52 -0000 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Tue, Jun 20, 2017 at 12:44:09PM +0100, Ryan Harkin wrote: > On 20 June 2017 at 12:28, Ard Biesheuvel wrote: > > (+ Laszlo) > > > > On 20 June 2017 at 13:00, Leif Lindholm wrote: > >> When building without LTO, gcc incorrectly resolves the hazards for > >> 'PciRegBase’ when inlining, leading to "may be used uninitialized" > >> warnings (and hence build failure with -Werror). > >> Eliminate this warning by explicitly initializing the variable to 0. > >> > >> Contributed-under: TianoCore Contribution Agreement 1.0 > >> Signed-off-by: Leif Lindholm > > > > Reviewed-by: Ard Biesheuvel > > Reviewed-by: Ryan Harkin Thanks! Pushed as 2f93c5077f. > > > >> --- > >> > >> For those who have heard me mentioning this before but arguing against > >> upstreaming this patch: I only just tweaked that this warning doesn't > >> go away with more recent toolchains, but simply when switching to GCC5 > >> build profile, and hence LTO. Build failure still reproducible with > >> gcc 6.3.1 and GCC49. > >> > > > > /me annoyed > > > > We keep hitting this with GCC, and I profoundly dislike having to add > > redundant initialization sequences. Is there any other solution > > possible, e.g., disable this warning for certain builds? > > > >> ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c | 1 + > >> 1 file changed, 1 insertion(+) > >> > >> diff --git a/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c b/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c > >> index da93eb5829..18491c7378 100644 > >> --- a/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c > >> +++ b/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c > >> @@ -343,6 +343,7 @@ ArmJunoSetNicMacAddress () > >> return Status; > >> } > >> > >> + PciRegBase = 0; > >> Status = InitPciDev (PciIo, &PciRegBase, &OldPciAttr); > >> if (EFI_ERROR (Status)) { > >> return Status; > >> -- > >> 2.11.0 > >>