From mboxrd@z Thu Jan 1 00:00:00 1970 From: Luc Van Oostenryck Subject: Re: ptrlist-iterator performance on one wine source file Date: Thu, 3 Aug 2017 00:50:20 +0200 Message-ID: References: <20170730151254.xlnz7c4zphhnhump@ltop.local> <20170801203357.4ywboptvr6tlytab@ltop.local> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from mail-qt0-f173.google.com ([209.85.216.173]:37740 "EHLO mail-qt0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751750AbdHBWuV (ORCPT ); Wed, 2 Aug 2017 18:50:21 -0400 Received: by mail-qt0-f173.google.com with SMTP id 16so35628961qtz.4 for ; Wed, 02 Aug 2017 15:50:21 -0700 (PDT) In-Reply-To: Sender: linux-sparse-owner@vger.kernel.org List-Id: linux-sparse@vger.kernel.org To: Christopher Li Cc: Linux-Sparse , Dibyendu Majumdar On Wed, Aug 2, 2017 at 3:17 AM, Christopher Li wrote: > On Tue, Aug 1, 2017 at 5:46 PM, Luc Van Oostenryck > wrote: >> has any effects for sparse and the only effect of -O2 is >> to define __OPTIMIZE__. > > Yes, indeed. It is the -O2 make the difference. > > I recently upgrade to Fedora 26. I think it is the system header file > making a difference > on the __OPTIMIZE__. I attach two files here. O2.c is the one with -O2 flag > after processor. The 0.c is the one without. > > There is huge difference in them. > > I confirm with O2.c I am seeing the 24 second delay. And 0.c 4 seconds. > > I attach the two files with gzip. It seems that the email was rejected on the mailing list. > I think you should be able to reproduce it with O2.c now. Yes, I can reproduce it now. The differences in the two file are not big. Basically, in -O2 there is - a bunch of small functions which have now an inline definition - a set of strcmp(winetest_platform, "wine") which are replaced by a macro of hell. It's, of course, the last one which creates the problem. The macro seems to try to optimize the compare using the fact that the compiler will statically evaluate things like: - strlen("wine") - "wine"[0], "wine"[1], ... but sparse doesn't do this kind of simplification (yet) and this result in much much more code. A first inspection of the generated code doesn't show anything obviously wrong but I don't exclude there is another problem. -- Luc