From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2675 invoked by alias); 2 Aug 2011 09:27:34 -0000 Received: (qmail 2667 invoked by uid 22791); 2 Aug 2011 09:27:33 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-yi0-f47.google.com (HELO mail-yi0-f47.google.com) (209.85.218.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 02 Aug 2011 09:27:17 +0000 Received: by yib18 with SMTP id 18so4633224yib.20 for ; Tue, 02 Aug 2011 02:27:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.151.122.7 with SMTP id z7mr1509773ybm.307.1312277236651; Tue, 02 Aug 2011 02:27:16 -0700 (PDT) Received: by 10.150.219.17 with HTTP; Tue, 2 Aug 2011 02:27:16 -0700 (PDT) In-Reply-To: <4E36F3BD.9080804@riverbed.com> References: <4E32F44F.7090201@riverbed.com> <4E330282.5000303@riverbed.com> <4E36F3BD.9080804@riverbed.com> Date: Tue, 02 Aug 2011 09:27:00 -0000 Message-ID: Subject: Re: Performance degradation on g++ 4.6 From: Richard Guenther To: Oleg Smolsky Cc: Xinliang David Li , gcc@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2011-08/txt/msg00038.txt.bz2 On Mon, Aug 1, 2011 at 8:43 PM, Oleg Smolsky wrote: > On 2011/7/29 14:07, Xinliang David Li wrote: >> >> Profiling tools are your best friend here. If you don't have access to >> any, the least you can do is to build the program with -pg option and >> use gprof tool to find out differences. > > The test suite has a bunch of very basic C++ tests that are executed an > enormous number of times. I've built one with the obvious performance > degradation and attached the source, output and reports. > > Here are some highlights: > =A0 =A0v4.1: =A0 =A0Total absolute time for int8_t constant folding: 30.4= 2 sec > =A0 =A0v4.6: =A0 =A0Total absolute time for int8_t constant folding: 43.3= 2 sec > > Every one of the tests in this section had degraded... the first half more > than the second. I am not sure how much further I can take this - the > benchmarked code is very short and plain. I can post disassembly for one > (some?) of them if anyone is willing to take a look... I have a hard time actually seeing what expressions they try to fold (argh, templates everywhere ...). One thing that changed between 4.1 and 4.6 is that we can no longer re-associate freely signed integers because of undefined overflow concerns - which is a correctness issue. Depending on the way the tests are written the folding in 4.1 was probably a bug. Richard. > Thanks, > Oleg. >