From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=17.151.62.29; helo=mail-in7.apple.com; envelope-from=afish@apple.com; receiver=edk2-devel@lists.01.org Received: from mail-in7.apple.com (mail-out7.apple.com [17.151.62.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 792DF21123864 for ; Wed, 20 Jun 2018 12:22:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; d=apple.com; s=mailout2048s; c=relaxed/simple; q=dns/txt; i=@apple.com; t=1529522576; x=2393436176; h=From:Sender:Reply-To:Subject:Date:Message-id:To:Cc:MIME-version:Content-type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-reply-to:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=X+QS2O+DaD+4I1VpiAhDScZXBjPW+lsz3M6Izs7ADUI=; b=vdP0Vx5JCmxyFosya6D/YxZc6ysXbNUQP0/X3jrS9P+1eXMES+FDhvQbagN1WHVT LUnKDHYDZTkGYGcdpJDA8bI0yu2AEbGquPs3dU0JzIbIW1A9m+HiNvLY9QKoSm9J LawzLV81lI5M1Wjb8A9oD7i3Z32mD7x1hKkDHTAs8i7XDooR7pPTf+qFDJb7x4dJ CTWPZJLcXFoB0hKHA0ET24dY7f2TNq+wM0044K+5je3Bov1KGKQGxRMEI60NvNuj e0fP7KpQFj2TpLVvRVBDSG7EhY6tq1+IRjjFFIJVTIMz4BkD4i0NeqA3AeRuq6FI RAUnGGBGS+htds5bhSvnXQ==; X-AuditID: 11973e16-6f1ff7000000740c-fe-5b2aa9909d3a Received: from mr2-mtap-s01.rno.apple.com (mr2-mtap-s01.rno.apple.com [17.179.226.133]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail-in7.apple.com (Apple Secure Mail Relay) with SMTP id 13.DC.29708.099AA2B5; Wed, 20 Jun 2018 12:22:56 -0700 (PDT) MIME-version: 1.0 Received: from nwk-mmpp-sz12.apple.com (nwk-mmpp-sz12.apple.com [17.128.115.204]) by mr2-mtap-s01.rno.apple.com (Oracle Communications Messaging Server 8.0.2.2.20180329 64bit (built Mar 29 2018)) with ESMTPS id <0PAM003LFZ68ZXA0@mr2-mtap-s01.rno.apple.com>; Wed, 20 Jun 2018 12:22:56 -0700 (PDT) Received: from process_viserion-daemon.nwk-mmpp-sz12.apple.com by nwk-mmpp-sz12.apple.com (Oracle Communications Messaging Server 8.0.2.2.20180403 64bit (built Apr 3 2018)) id <0PAM00G00YXFTA00@nwk-mmpp-sz12.apple.com>; Wed, 20 Jun 2018 12:22:56 -0700 (PDT) X-Va-A: X-Va-T-CD: 9b3859669d90162ac484de95f7f3dbd2 X-Va-E-CD: 231719eec8eee07a37a6b4be3c48cb1b X-Va-R-CD: d1251d2bc59a5c119125a5ee43ca8413 X-Va-CD: 0 X-Va-ID: c6f4ea4d-45a0-4fb5-8ea0-a56458eb6a9b X-V-A: X-V-T-CD: 6a8fe94fde202cff83873853a5e2c49c X-V-E-CD: 231719eec8eee07a37a6b4be3c48cb1b X-V-R-CD: d1251d2bc59a5c119125a5ee43ca8413 X-V-CD: 0 X-V-ID: 7e5f8009-2757-49e4-a0d3-cf02a39ce44e Received: from process_milters-daemon.nwk-mmpp-sz12.apple.com by nwk-mmpp-sz12.apple.com (Oracle Communications Messaging Server 8.0.2.2.20180403 64bit (built Apr 3 2018)) id <0PAM00G00YW73V00@nwk-mmpp-sz12.apple.com>; Wed, 20 Jun 2018 12:22:56 -0700 (PDT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-06-20_09:,, signatures=0 X-Proofpoint-Scanner-Instance: nwk-grpmailp-qapp14.corp.apple.com-10000_instance1 Received: from [17.114.153.76] (unknown [17.114.153.76]) by nwk-mmpp-sz12.apple.com (Oracle Communications Messaging Server 8.0.2.2.20180403 64bit (built Apr 3 2018)) with ESMTPSA id <0PAM00BVVZ68QB90@nwk-mmpp-sz12.apple.com>; Wed, 20 Jun 2018 12:22:56 -0700 (PDT) Sender: afish@apple.com From: Andrew Fish Message-id: <91C2476D-6C4B-4D0E-827F-1F6DC597E617@apple.com> Date: Wed, 20 Jun 2018 12:22:55 -0700 In-reply-to: Cc: Laszlo Ersek , nd , "edk2-devel@lists.01.org" , Stephanie Hughes-Fitt , Leif Lindholm To: Ard Biesheuvel References: X-Mailer: Apple Mail (2.3445.6.18) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprNKsWRmVeSWpSXmKPExsUiuPlRq+6ElVrRBrO3mFv8/7Cb0WLPoaPM Fp9272GxWHZsB4vFmeU9zBaPZ7YxObB5rJm3htHjzrU9bB7ds/+xeLzfd5UtgCWKyyYlNSez LLVI3y6BK+PLtkNMBVO6GCvO3trL3MA4raKLkZNDQsBE4tqKo0xdjFwcQgIHmCQmTPvOApLg FRCU+DH5HpjNLBAmcbx/JiNE0XomiZe7T7FAOF1MEtP/n2eCGMUu8efXDqAEB5CtLdG80gci rC2x7f0+Nhh7zssuqHIuiQVbT7NC2LoSVx/A2GwS608sgarRkli9ZQUzjL3+wAUWGHvJnIvs EDanxPkvE6FsHYkfO3ZCHdrJJHGu9wJUIlvi5as2KDtY4uS6RnaIoolMEgem/QTbJiwgLvHu zCawbWwCyhIr5n9ghwSFjcTWL8+YQR4TFjCX2HczGyTMIqAq0XxrFtjRnEAzL515Bg5GZoGL jBLn100GqxcR0JNo6TKD2LWASWLR7mlQ3yhJ/N91hHkCo8IspNCehRTaELaWxPdHrUBxDiBb XuLgeVmIsKbEs3uf2CFsbYkn7y6wLmBkW8UolJuYmaObmWeul1hQkJOql5yfu4kRlJqm24nt YHy4yuoQowAHoxIPb0OIVrQQa2JZcWXuIUZpDhYlcd6jSRrRQgLpiSWp2ampBalF8UWlOanF hxiZODilGhinXs302Xvl8a/cZ517JhtYNOsHWu0Pt7zqOtOs703/zrDVK2L4d25tfaqYzXLA N1MkKo9hWfa2DT+tJPw6/RN3W5369GvZ0ekG8l2blidc+5zocNmclzVUQ61zS/xjUTWO7rTz G9lWOKhICN/qVTNoO8cRLDjxQs3r5g+axjPyXi67EcFmLafEUpyRaKjFXFScCAARMM4oLgMA AA== X-Content-Filtered-By: Mailman/MimeDel 2.1.26 Subject: Re: Query about variable initialization X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2018 19:22:57 -0000 Content-Type: text/plain; CHARSET=US-ASCII Content-Transfer-Encoding: 7BIT > On Jun 20, 2018, at 12:01 PM, Ard Biesheuvel wrote: > > On 20 June 2018 at 20:57, Laszlo Ersek > wrote: >> On 06/20/18 20:03, Ard Biesheuvel wrote: >>> On 20 June 2018 at 19:48, Evan Lloyd wrote: >>>> Hi Ard, Leif. >>>> I've noticed a number of comments like Ard's recent "We don't permit initialized automatic variables.", >>>> and similar changes have been made to Sami's AcpiView. Note: I'm not objecting to doing it the way maintainers prefer, which is why this is not a response. >>>> >>>> My understanding was that the CCS was changed some time back to remove the restriction on initializing variables (and I further think I remember Leif being a prime mover in that). >>> >>> I don't remember, to be honest. But I think it is a stupid rule, and >>> so if we haven't already, I hope we can get rid of it. >>> >>> IIRC, this limitation had something to do with a particularly nice >>> exhibit in the Tianocore toolchain museum that generated bigger >>> binaries for initialized automatic variables (as compared to >>> assignments performed separately). But let's not get into the >>> toolchain situation, shall we? >> >> One special case of initialization is when the variable in question has >> structure type. For such initialization the compiler may generate calls >> to internal helper functions (memset and friends), and then the module >> fails to link. I've seen this myself earlier, although I can't tell >> whether on gcc-4.4 or gcc-4.8. >> > > That is a very good point. Note that this does not affect ARM, given > that we already have to provide the AEABI intrinsics (and memset and > memcpy for GCC), but I can see how other architectures may be bitten > by this. > > I suppose the compiler is free to apply the same optimization to a > block of automatic POD type variables, although I'd be surprised if > that ever occurs in practice. What I find is it breaks NOOPT builds, -O0 for clang specifically. Especially for projects that don't have a global NOOPT build due to FLASH Size. That common place I hit this it trying to turn off optimization to walk some code in the debugger to understand how it works and now it does not link. Usually I'm doing something like this in the INF, or the equivalent in the DSC, and boom. [BuildOptions] XCODE:*_*_*_CC_FLAGS = -O0 -fno-lto Thanks, Andrew Fish > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel