Newsgroups: php.internals,php.internals.win Path: news.php.net Xref: news.php.net php.internals:89312 php.internals.win:1131 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 17931 invoked from network); 23 Nov 2015 08:31:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Nov 2015 08:31:14 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.223.169 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.223.169 mail-io0-f169.google.com Received: from [209.85.223.169] ([209.85.223.169:34661] helo=mail-io0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A4/92-01565-DCEC2565 for ; Mon, 23 Nov 2015 03:31:13 -0500 Received: by ioir85 with SMTP id r85so180002498ioi.1 for ; Mon, 23 Nov 2015 00:31:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zend-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=PpX1+DsPwRS3Zye++CZ32iQq3d0JKzpzrpHdmC+2SRI=; b=Hpv8ARaZhIiVqbPEuj5OIbWkhM5jY0koNTLftuZw4Qmyq6J8p9tidJp1FN2nwYs6nl ADioxcHRhLXW8P+aKF1GSXdQavYzzlOAaK2Da1bWKfpHmS3WmSRUHdkQmzhHCIyEWuGZ koeRIBZv95kGhvswvmhOIyulIEhIvqfExKm1sycsGQEL+/TdzOtEEQUvDt0m/i+1Ullc eeA6CzIpSktQrtf7BQ2elA7/MmKV/8XICKPz6+DNfblOoVt2kTacW25IRzf/D9g6xgkr 2nMd5cIGZp1wVnSNOgaZemOY8pOWYAsKTXMrPjTldtqxCo1KZiapKQbN3gqD1f6kOitK HtJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=PpX1+DsPwRS3Zye++CZ32iQq3d0JKzpzrpHdmC+2SRI=; b=PdXHE/QTnrcy2KrvpCFHDLGlUqfeKLWVcHUopYDOPSDsScq9W+0ug7/OjlKAb/89cw 7fy+MRHYVxiNccEERpyWgs72Hr3HZtE+IKgmvxGJ5IetIoG2v9pe4O69BvG2uTMBtLZ9 qecm68OXDeCwneT3B0wufhmahadPLDJchpz+DN04C8tnxww+rkfOf0Yfr84Y0JnZQ2qo mZ0nW2Y8BAPBN1f0LACPDh1Bk3p01vCdRFzI1PLJYRmXNtOSXBocgEH/UbjgUpuF7MRR cz5wLQ4TLY5lMheFjsNvHWFAZutxRSbR9tWTdyFc5UcHroyWSnGrsTpqjopn9KcpcpT8 1Y4w== X-Gm-Message-State: ALoCoQkW44o33MtSHu6EZGxptZHGAtl5qH9zBw6Iy3tGBZ3Rlkqp486JPrxouI1ghAm6Aw3yf7ic+jy2/4W5PeFLppR1/YTa9pnxtZWMT8Pka2fgoxGaCkzb6bjYD92NzgI4H69xVJ7Ad+QxP5+Dl5ser4SAYD4aYPEDsNuJKMzO+z/UAlpszD0= MIME-Version: 1.0 X-Received: by 10.107.35.69 with SMTP id j66mr24764635ioj.51.1448267466282; Mon, 23 Nov 2015 00:31:06 -0800 (PST) Received: by 10.50.128.201 with HTTP; Mon, 23 Nov 2015 00:31:06 -0800 (PST) In-Reply-To: References: <9B23C6783EE5480CB15EAC35B9E420EA@pc1> Date: Mon, 23 Nov 2015 11:31:06 +0300 Message-ID: To: Matt Wilmas Cc: PHP Internals , internals-win@lists.php.net, Anatol Belski , Pierre Joye Content-Type: multipart/alternative; boundary=001a1140f378de39320525310bed Subject: Re: [PHP-DEV] Re: Windows (Visual Studio) compiler stuff From: dmitry@zend.com (Dmitry Stogov) --001a1140f378de39320525310bed Content-Type: text/plain; charset=UTF-8 On Mon, Nov 23, 2015 at 8:08 AM, Matt Wilmas wrote: > Hi Dmitry, > > ----- Original Message ----- > From: "Dmitry Stogov" > Sent: Monday, November 16, 2015 > > Hi Matt, >> >> On Mon, Nov 16, 2015 at 1:30 AM, Matt Wilmas >> wrote: >> >> Hi Dmitry, Anatol, Pierre (etc.), and all, >>> >>> I'm back now, I think, after a much longer (unintentional) break than I >>> expected. Be coming very soon with what I was doing in the summer (param >>> parsing stuff) -- *now* it works with MSVC too, barring any fragility, >>> as I >>> accidentally discovered last month... >>> >>> I've been "discovering" a lot with the wacky Visual Studio compiler! :-) >>> This message is about the 2 I found today. >>> >>> The first simple thing was probably just overlooked, but noticed it while >>> looking up __declspec. zend_never_inline has always been empty (I guess) >>> for MSVC, but there's actually a __declspec(noinline) that can be used >>> (and >>> works as expected). A simple and obvious change to bring it in line with >>> the other compilers? >>> >>> >> Please, provide a patch for zend_portability.h >> > > Really? :-) And that's easier than just adding > > __declspec(noinline) > > to line 287? > > I can add it myself soon, if it's acceptable. And yes, I verified that it > does have an effect, and prevents current inlining, as you intended. (12 > KB smaller binary.) > I don't test Windows builds. If this OK for Anatol - just commit this. Thanks. Dmitry. > > The second "issue" is with the zend_always_inline functions, I noticed >>> this summer. Did anyone else know that MSVC leaves a *copy* of those >>> functions in the output files (DLLs)? What's the point of that? When >>> they've been inlined, and not referenced otherwise, there should be no >>> reason to emit code for a standalone function! >>> >>> I remembered after seeing that behavior that a bit of my own >>> __forceinline'd code did NOT have extra function code, but forgot to >>> investigate until today. What's different about my function definition? >>> No "static" specifier! So that's the key. :-) >>> >>> But... non-static would create duplicate symbols, I thought. But no, it >>> works! With just __forceinline, there's no errors. :^) >>> >>> Can something be done about this? It would cut the binary size down a >>> bit. A zend_static macro to be used with zend_always_inline...? >>> >>> >> zend_always inline should be always used with static keyword. >> > > Right, that would be the standard thinking, but it makes MSVC not remove > the unreferenced standalone function like GCC/Clang... Adds almost 100 KB > to php7.dll. > > But nevermind... Thanks to Anatol, it seems another compiler flag WILL > actually strip those functions, and then some! :-) > > Thanks. Dmitry. >> > > - Matt > --001a1140f378de39320525310bed--