From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4456 invoked by alias); 28 Sep 2011 10:55:17 -0000 Received: (qmail 4448 invoked by uid 22791); 28 Sep 2011 10:55:16 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-ey0-f175.google.com (HELO mail-ey0-f175.google.com) (209.85.215.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 28 Sep 2011 10:55:02 +0000 Received: by eya25 with SMTP id 25so5598013eya.20 for ; Wed, 28 Sep 2011 03:55:01 -0700 (PDT) Received: by 10.14.2.71 with SMTP id 47mr3122013eee.226.1317207301163; Wed, 28 Sep 2011 03:55:01 -0700 (PDT) Received: from richards-thinkpad.stglab.manchester.uk.ibm.com (rsandifo.gotadsl.co.uk. [82.133.89.107]) by mx.google.com with ESMTPS id 11sm58204429eeu.4.2011.09.28.03.54.59 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 28 Sep 2011 03:55:00 -0700 (PDT) From: Richard Sandiford To: Jan Hubicka Mail-Followup-To: Jan Hubicka ,"H.J. Lu" , gcc-patches@gcc.gnu.org, rguenther@suse.de, mjambor@suse.cz, richard.sandiford@linaro.org Cc: "H.J. Lu" , gcc-patches@gcc.gnu.org, rguenther@suse.de, mjambor@suse.cz Subject: Re: [RFC] Context sensitive inline analysis References: <20110422123553.GB8655@kam.mff.cuni.cz> <20110927144617.GF21364@kam.mff.cuni.cz> Date: Wed, 28 Sep 2011 11:56:00 -0000 In-Reply-To: <20110927144617.GF21364@kam.mff.cuni.cz> (Jan Hubicka's message of "Tue, 27 Sep 2011 16:46:17 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-09/txt/msg01817.txt.bz2 Jan Hubicka writes: > the problem is sign overflow in time computation. Time should be > capped by MAX_TIME and we compute MAX_TIME * INLINE_SIZE_SCALE * > 2. This happens to be >2^31 & <2^32 so we overflow here because of use > of signed arithmetics. > > Index: ipa-inline-analysis.c > =================================================================== > --- ipa-inline-analysis.c (revision 179266) > +++ ipa-inline-analysis.c (working copy) > @@ -92,7 +92,7 @@ along with GCC; see the file COPYING3. > /* Estimate runtime of function can easilly run into huge numbers with many > nested loops. Be sure we can compute time * INLINE_SIZE_SCALE in integer. > For anything larger we use gcov_type. */ > -#define MAX_TIME 1000000 > +#define MAX_TIME 500000 > > /* Number of bits in integer, but we really want to be stable across different > hosts. */ Could you update the comment too? ("time * INLINE_SIZE_SCALE * 2") Richard