From: Richard Sandiford <richard.sandiford@linaro.org>
To: Jan Hubicka <hubicka@ucw.cz>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [RFC] Context sensitive inline analysis
Date: Mon, 03 Oct 2011 08:12:00 -0000 [thread overview]
Message-ID: <g48vp2lcj5.fsf@richards-thinkpad.stglab.manchester.uk.ibm.com> (raw)
In-Reply-To: <g4mxdp543h.fsf@richards-thinkpad.stglab.manchester.uk.ibm.com> (Richard Sandiford's message of "Wed, 28 Sep 2011 11:54:58 +0100")
Richard Sandiford <richard.sandiford@linaro.org> writes:
> Jan Hubicka <hubicka@ucw.cz> 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")
OK, I did it myself. Tested on x86_64-linux-gnu and applied as obvious.
Richard
gcc/
* ipa-inline-analysis.c (MAX_TIME): Update comment.
Index: gcc/ipa-inline-analysis.c
===================================================================
--- gcc/ipa-inline-analysis.c 2011-10-03 09:10:21.000000000 +0100
+++ gcc/ipa-inline-analysis.c 2011-10-03 09:10:55.633044417 +0100
@@ -90,8 +90,8 @@ Software Foundation; either version 3, o
#include "alloc-pool.h"
/* 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. */
+ nested loops. Be sure we can compute time * INLINE_SIZE_SCALE * 2 in an
+ integer. For anything larger we use gcov_type. */
#define MAX_TIME 500000
/* Number of bits in integer, but we really want to be stable across different
next prev parent reply other threads:[~2011-10-03 8:12 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-22 14:17 Jan Hubicka
2011-04-22 21:02 ` Jan Hubicka
2011-04-23 0:14 ` Jan Hubicka
2011-04-23 10:47 ` Richard Guenther
2011-04-23 17:00 ` Jan Hubicka
2011-05-27 8:31 ` H.J. Lu
2011-05-27 8:52 ` H.J. Lu
2011-09-27 16:20 ` Jan Hubicka
2011-09-28 11:56 ` Richard Sandiford
2011-10-03 8:12 ` Richard Sandiford [this message]
2011-04-25 15:35 David Edelsohn
2011-04-26 13:02 ` Jan Hubicka
2011-04-27 13:18 ` Jan Hubicka
2011-04-27 14:38 ` H.J. Lu
2011-04-27 15:46 ` Jan Hubicka
2011-04-28 13:27 ` David Edelsohn
2011-04-28 13:43 ` Jan Hubicka
[not found] ` <BANLkTikScRy+QwZiPyGhHhmuu+ACF65HJA@mail.gmail.com>
2011-04-30 13:38 ` Jan Hubicka
2011-04-30 16:38 ` David Edelsohn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=g48vp2lcj5.fsf@richards-thinkpad.stglab.manchester.uk.ibm.com \
--to=richard.sandiford@linaro.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=hubicka@ucw.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).