From: Jeff Law <law@redhat.com>
To: Bernd Edlinger <bernd.edlinger@hotmail.de>,
"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH][ PR rtl-optimization/79286] Drop may_trap_p exception to testing dominance in update_equiv_regs
Date: Fri, 23 Jun 2017 04:35:00 -0000 [thread overview]
Message-ID: <7646ae03-937a-2ead-9845-128c51547773@redhat.com> (raw)
In-Reply-To: <AM4PR0701MB216212D47DFF1723ED41F7E6E4120@AM4PR0701MB2162.eurprd07.prod.outlook.com>
On 04/29/2017 01:06 AM, Bernd Edlinger wrote:
> On 04/28/17 20:46, Jeff Law wrote:
>> On 04/28/2017 11:27 AM, Bernd Edlinger wrote:
>>> Yes I agree, that is probably not worth it. So I could try to remove
>>> the special handling of PIC+const and see what happens.
>>>
>>> However the SYMBOL_REF_FUNCTION_P is another story, that part I would
>>> like to keep: It happens quite often, already w/o -fpic that call
>>> statements are using SYMBOL_REFs to ordinary (not weak) function
>>> symbols, and may_trap returns 1 for these call statements wihch is IMHO
>>> wrong.
>> Hmm, thinking more about this, wasn't the original case a PIC referrence
>> for something like &x[BIGNUM].
>>
>> Perhaps we could consider a PIC reference without other arithmetic as
>> safe. That would likely pick up the SYMBOL_REF_FUNCTION_P case you want
>> as well good deal many more PIC references as non-trapping.
>>
> Yes, I like this idea.
>
> I tried to compile openssl with -m32 -fpic as an example, and counted
> how often the mem[pic+const] is hit: that was 2353 times, all kind of
> object refs.
>
> Then I tried your idea, and only 54 unhandled pic refs remained, all of
> them looking like this:
>
> (plus:SI (reg:SI 107)
> (const:SI (plus:SI (unspec:SI [
> (symbol_ref:SI ("bf_init") [flags 0x2] <var_decl
> 0x2ac00f7bac60 bf_init>)
> ] UNSPEC_GOTOFF)
> (const_int 4164 [0x1044]))))
>
> I believe that is a negligible fall out from such a big code base.
>
> Although the pic references do no longer reach the
> SYMBOL_REF_FUNCTION_P in this version of the patch, I still see
> that happening without -fpic option, so I left it as is.
>
>
> Attached is the new version of my patch.
>
> Bootstrapped and reg-tested on x86_64-pc-linux-gnu.
> Is it OK for trunk?
>
>
> Thanks
> Bernd.
>
>
> patch-pr79286.diff
>
>
> 2017-04-29 Bernd Edlinger <bernd.edlinger@hotmail.de>
>
> rtl-optimizatoin/79286
> * ira.c (update_equiv_regs): Revert to using may_tap_p again.
> * rtlanal.c (rtx_addr_can_trap_p_1): SYMBOL_REF_FUNCTION_P can never
> trap. PIC register plus a const unspec without offset can never trap.
OK. Sorry for the delay. I've been swamped.
jeff
next prev parent reply other threads:[~2017-06-23 4:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-23 18:33 Bernd Edlinger
2017-04-28 17:17 ` Jeff Law
2017-04-28 18:05 ` Bernd Edlinger
2017-04-28 19:01 ` Jeff Law
2017-04-28 20:23 ` Bernd Edlinger
2017-04-28 20:27 ` Bernd Edlinger
2017-04-29 9:27 ` Bernd Edlinger
2017-05-12 16:49 ` [PING][PATCH][ " Bernd Edlinger
2017-06-01 16:00 ` [PING**2][PATCH][ " Bernd Edlinger
[not found] ` <59f99a5b-e5db-7078-5f55-c4b42f9c4a8b@hotmail.de>
2017-06-14 12:43 ` [PING**3][PATCH][ " Bernd Edlinger
2017-06-23 4:35 ` Jeff Law [this message]
-- strict thread matches above, loose matches on Subject: below --
2017-02-24 15:48 [PATCH][ " Jeff Law
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=7646ae03-937a-2ead-9845-128c51547773@redhat.com \
--to=law@redhat.com \
--cc=bernd.edlinger@hotmail.de \
--cc=gcc-patches@gcc.gnu.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).