public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Bernd Edlinger <bernd.edlinger@hotmail.de>
Cc: Jakub Jelinek <jakub@redhat.com>,
	"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	Jeff Law <law@redhat.com>, 	Eric Botcazou <ebotcazou@adacore.com>
Subject: Re: [RFC] Sanitize rtx_addr_can_trap_p_1
Date: Thu, 11 Jun 2015 14:40:00 -0000	[thread overview]
Message-ID: <CAFiYyc2vHOfWVqGj9OknRT+BQfgFM4FBNFEFyBbziA=WgCrc_Q@mail.gmail.com> (raw)
In-Reply-To: <DUB118-W4679BED5FF3856E26A112BE4BC0@phx.gbl>

On Thu, Jun 11, 2015 at 4:34 PM, Bernd Edlinger
<bernd.edlinger@hotmail.de> wrote:
> Hi,
>
> On Thu, 11 Jun 2015 12:57:34 +0200, Jakub Jelinek wrote:
>>
>> On Thu, Jun 11, 2015 at 12:38:40PM +0200, Bernd Edlinger wrote:
>>> On Thu, 11 Jun 2015 10:02:03, Jakub Jelinek wrote:
>>>>
>>>> IMHO the
>>>> #if 0
>>>> #endif
>>>> stuff doesn't belong to the patch.
>>>>
>>>
>>> I just wanted to leave a hint, how I debugged this function, and how
>>> to assess the performance of the decision that is taken here.
>>
>> What I usually do in these cases is something like:
>> FILE *f = fopen ("/tmp/mylogfile", "a");
>> fprintf (f, "%s %d ...\n", main_input_filename ? main_input_filename : "-", (int) BITS_PER_WORD, ...);
>> fclose (f);
>> and do full bootstrap/regtest (usually both x86_64-linux and i686-linux)
>> with it, then look at the log file.
>> But I keep those for myself, don't keep them even as comments.
>> In this case, you could post the hack as incremental patch for interested
>> folks to test on their architecture, but I'm not convinced we want to keep
>> it in the source, whether #if 0 or in a comment.
>>
>
> I am not too sure about it either.
>
> But I think, it is quite helpful data, however I am even tempted
> to add the name of the current function, and the pass we are in at the moment,
> but I have no idea how to grab that information...
>
>> So, for a full bootstrap/regtest, how many log messages do you get, and are
>> they always resolved conservatively (i.e. if unsure the offset is ok, return
>> 1)?
>>
>
>
> In stage 2 of the build (with all languages) I get:
>
> 2930 messages of the form
> *** frame can trap: offset=16, size=8, low_bound=-3152, high_bound=0
>
> 74 messages of the form
> *** sp can trap: offset=112, size=4, low_bound=-144, high_bound=112
>
> 202 messages of the from
> *** argp can trap: offset=16, size=8, low_bound=-56, high_bound=16
>
> 10 messages of the form
> *** fp can trap: offset=40, size=4, low_bound=-264, high_bound=24
>
>
> My patch does not change the handling of frame_pointer_rtx,
> except that it avoids a possible integer overflow in "adj_offset + size - 1>= 0"
> so these 2930 suppressed optimizations were already introduced by Eric's patch.
>
> I think that is probably a new effect, that [FP+x] is now used more
> often than before to access values at [ARGP+x].  I have not tried, but
> maybe it would be possible to use the crtl->args.size, here too, to get more
> optimistic upper bounds on the argument sizes.
>
>
> So all in all my patch changed 286 times the return value of rtx_addr_can_trap_p_1
> in the whole pass 2.
>
> But OTOH there are millions of times, where the rtx_addr_can_trap_p_1
> returns 0, which is rtx can not trap.

Sounds like a red-zone is not accounted for?

Richard.

>
> Bernd.
>

  reply	other threads:[~2015-06-11 14:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-11  7:48 Bernd Edlinger
2015-06-11  8:40 ` Jakub Jelinek
2015-06-11 10:44   ` Bernd Edlinger
2015-06-11 10:57     ` Richard Biener
2015-06-11 16:04       ` Bernd Edlinger
2015-06-11 11:00     ` Jakub Jelinek
2015-06-11 14:38       ` Bernd Edlinger
2015-06-11 14:40         ` Richard Biener [this message]
2015-06-11 15:55           ` Bernd Edlinger
2015-06-11 11:29   ` Eric Botcazou
2015-06-11 11:57     ` Jakub Jelinek
2015-06-12  9:24     ` Bernd Edlinger
2015-06-15  9:03 ` Bernd Edlinger
2015-07-01 12:31   ` [PING] " Bernd Edlinger
2015-07-01 12:35     ` Jakub Jelinek

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='CAFiYyc2vHOfWVqGj9OknRT+BQfgFM4FBNFEFyBbziA=WgCrc_Q@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=bernd.edlinger@hotmail.de \
    --cc=ebotcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=law@redhat.com \
    /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).