public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Martin Liška" <mliska@suse.cz>
To: Richard Biener <richard.guenther@gmail.com>,
	Jeff Law <law@redhat.com>, GCC Patches <gcc-patches@gcc.gnu.org>,
	Richard Sandiford <richard.sandiford@linaro.org>,
	Ilya Enkovich <enkovich.gnu@gmail.com>
Subject: Re: [PATCH] Fix compile-time hog in MPX boundary checking (PR target/84988).
Date: Wed, 21 Mar 2018 09:47:00 -0000	[thread overview]
Message-ID: <7d705ae8-8c44-d9d6-7c28-0a5c8e61cea6@suse.cz> (raw)
In-Reply-To: <CAFiYyc2EqUvmtFu83WXdFcQ6mRA__POwTE5fpGRdqug9t8nnNA@mail.gmail.com>

On 03/21/2018 10:36 AM, Richard Biener wrote:
> On Tue, Mar 20, 2018 at 10:44 PM, Richard Sandiford
> <richard.sandiford@linaro.org> wrote:
>> Jeff Law <law@redhat.com> writes:
>>> On 03/20/2018 01:36 PM, Martin Liška wrote:
>>>> Hi.
>>>>
>>>> This is a work-around to not iterate all members of array that can be huge.
>>>> As MPX will be removed in GCC 9.x, I hope it's acceptable. I don't want
>>>> to come
>>>> up with a new param for it.
>>>>
>>>> Survives tests&bootstrap on x86_64-linux-gnu.
>>>>
>>>> Martin
>>>>
>>>> gcc/ChangeLog:
>>>>
>>>> 2018-03-20  Martin Liska  <mliska@suse.cz>
>>>>
>>>>      PR target/84988
>>>>      * tree-chkp.c (CHKP_ARRAY_MAX_CHECK_STEPS): Define a new macro.
>>>>      (chkp_find_bound_slots_1): Limit number of iterations.
>>> Or just CLOSE/WONTFIX :-)
>>>
>>> I've got no objections here -- we want to  minimize the effort put into
>>> CHKP given its going to be deprecated.
>>
>> The problem is that this affects normal configs, not just ones with
>> MPX enabled.
> 
> Indeed.  It get's called via
> 
> #0  chkp_find_bound_slots_1 (type=0x7ffff69ee9d8, have_bound=0x2ed3868, offs=0)
>      at /space/rguenther/src/svn/early-lto-debug/gcc/tree-chkp.c:1708
> #1  0x0000000001379a13 in chkp_find_bound_slots (type=0x7ffff69ee9d8,
>      res=0x2ed3868)
>      at /space/rguenther/src/svn/early-lto-debug/gcc/tree-chkp.c:1754
> #2  0x0000000001377054 in chkp_type_bounds_count (type=0x7ffff69ee9d8)
>      at /space/rguenther/src/svn/early-lto-debug/gcc/tree-chkp.c:1009
> #3  0x00000000016c664f in ix86_function_arg_advance (cum_v=...,
>      mode=E_BLKmode, type=0x7ffff69ee9d8, named=true)
>      at /space/rguenther/src/svn/early-lto-debug/gcc/config/i386/i386.c:8621
> 8616        {
> 8617          /* Track if there are outgoing arguments on stack.  */
> 8618          if (cum->caller)
> 8619            cfun->machine->outgoing_args_on_stack = true;
> 8620
> 8621          cum->bnds_in_bt = chkp_type_bounds_count (type);
> 8622        }
> 8623    }
> 8624
> 8625    /* Define where to put the arguments to a function.
> 
> but I think we know POINTER_BOUNDS_TYPE_P etc. never return
> true if -fcheck-pointer-* or -mmpx is not enabled, right?  So we can
> guard the above call appropriately and save some compile-time
> for all of us?

Good observation, let me enhance the patch for the PR.

Martin

> 
> Richard.
> 
>> Thanks,
>> Richard

  reply	other threads:[~2018-03-21  9:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-20 19:37 Martin Liška
2018-03-20 19:40 ` Jeff Law
2018-03-20 21:53   ` Richard Sandiford
2018-03-21  9:40     ` Richard Biener
2018-03-21  9:47       ` Martin Liška [this message]
2018-03-21 12:45         ` Martin Liška
2018-03-21 13:26           ` Jakub Jelinek
2018-03-28  6:51             ` Martin Liška
2018-03-28 11:53               ` 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=7d705ae8-8c44-d9d6-7c28-0a5c8e61cea6@suse.cz \
    --to=mliska@suse.cz \
    --cc=enkovich.gnu@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@redhat.com \
    --cc=richard.guenther@gmail.com \
    --cc=richard.sandiford@linaro.org \
    /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).