Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87666 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59243 invoked from network); 6 Aug 2015 09:00:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Aug 2015 09:00:53 -0000 Authentication-Results: pb1.pair.com header.from=php_lists@realplain.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=php_lists@realplain.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain realplain.com from 68.114.190.26 cause and error) X-PHP-List-Original-Sender: php_lists@realplain.com X-Host-Fingerprint: 68.114.190.26 mtaout001-public.msg.strl.va.charter.net Received: from [68.114.190.26] ([68.114.190.26:6754] helo=mtaout001.msg.strl.va.charter.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 04/E4-22467-34223C55 for ; Thu, 06 Aug 2015 05:00:52 -0400 Received: from impout003 ([68.114.189.18]) by mtaout001.msg.strl.va.charter.net (InterMail vM.9.00.020.01 201-2473-160) with ESMTP id <20150806090049.KKLX28847.mtaout001.msg.strl.va.charter.net@impout003>; Thu, 6 Aug 2015 04:00:49 -0500 Received: from pc1 ([96.35.251.86]) by impout003 with charter.net id 1M0o1r00D1sc0so01M0o7J; Thu, 06 Aug 2015 04:00:49 -0500 X-Authority-Analysis: v=2.1 cv=Pvkdbm83 c=1 sm=1 tr=0 a=Is5gsZaFXO8aPum+t7Tz+g==:117 a=Is5gsZaFXO8aPum+t7Tz+g==:17 a=hOpmn2quAAAA:8 a=BCPeO_TGAAAA:8 a=N659UExz7-8A:10 a=C214FNdpoGhak9PzZFwA:9 a=qEZQUrBQMdnBbXdK:21 a=qhE5RttPx7wsE1sl:21 a=pILNOxqGKmIA:10 Message-ID: To: "Pierre Joye" Cc: "Yasuo Ohgaki" , "Ferenc Kovacs" , "PHP Internals" , "Dmitry Stogov" , "Levi Morrison" References: <051CB45EE4B24C7C88C3EABC7E8EE0A2@pc1><77CE51405C92499BA13CE0913883EE05@pc1> Date: Thu, 6 Aug 2015 04:00:48 -0500 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Subject: Re: [PHP-DEV] Move to Fast ZPP? From: php_lists@realplain.com ("Matt Wilmas") Hi Pierre, ----- Original Message ----- From: "Pierre Joye" Sent: Thursday, August 06, 2015 > On Aug 6, 2015 1:49 PM, "Matt Wilmas" wrote: >> >> Hi Levi, >> >> >> ----- Original Message ----- >> From: "Levi Morrison" >> Sent: Thursday, August 06, 2015 >> >>>> Don't know about Windows now... Visual Studio 2008 and 2012 (not much >>>> difference) are NOT optimizing away the code (other times it was GCC > with >>>> issues). :-/ Not sure why. Of course they don't support the necessary >>>> compound literals anyway, but I was just testing a manual case... I'll > have >>>> to try and check 2015 version soon. >>> >>> >>> VS 2015 supports compound literals, I believe. >> >> >> Yes, VS 2013 added, AFAIK. But I was just talking about optimizing the > code that would use them. A compound literal (void *[]), derived from > variadic macro, is needed to transform zend_parse_parameters() into a > non-varargs inline function call (since va_arg usage prevents inlining). >> >> The problem in the earlier VS versions, which I simulated manually > without compound literals, is that it doesn't want to optimize away all > the > inlined stuff, leaving only the result. Definitely can't have something > creating several KB of extra instructions! :-) >> >> So unless they improved something in the newest versions, this wouldn't > be able to be used there, unless I can work around it somehow. I don't > know if macros, instead of inline functions, inside the main inline > function would help or not... >> >> Although, it *would* simplify a couple tiny parts if didn't need to > support MSVC... First, detecting a string *literal* (99% of usage): could > just use __builtin_constant_p() instead of a macro trick. >> >> And second, using a variable length array, with size set by, well, a > variable, which I think VS still doesn't support from C99, right? (It's > for a "variable" in this case, but always the same, so should optimize > like > a compile-time size.) > > If you have a piece of self contained code to test it, we can then add it > to the VC test repo to valid what we can support with 7+. Sure! Simply: size_t num = 4; char foo[num]; I wondered about emulating with _alloca(), but a quick check (in 2008!) shows that it doesn't optimize it out even with a true constant value... - Matt