From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
To: gcc-patches@gcc.gnu.org,Richard Biener <rguenther@suse.de>,Jan
Hubicka <hubicka@ucw.cz>
Cc: d@dcepelik.cz
Subject: Re: Make nonoverlapping_component_refs work with duplicated main variants
Date: Tue, 09 Jul 2019 21:03:00 -0000 [thread overview]
Message-ID: <45CE5AFB-5FBC-4044-91E0-B89DB1B84407@gmail.com> (raw)
In-Reply-To: <alpine.LSU.2.20.1907091531160.2976@zhemvz.fhfr.qr>
On 9 July 2019 15:37:30 CEST, Richard Biener <rguenther@suse.de> wrote:
>On Tue, 9 Jul 2019, Jan Hubicka wrote:
>
>> Hi,
>> this is updated variant I am testing.
>> It documents better how function works and streamlines the checks.
>>
>> OK assuming it passes the tests?
>>
>> Honza
>>
>> Index: tree-ssa-alias.c
>> ===================================================================
>> --- tree-ssa-alias.c (revision 273193)
>> +++ tree-ssa-alias.c (working copy)
>> @@ -1128,6 +1128,91 @@ aliasing_component_refs_p (tree ref1,
>> return false;
>> }
>>
>> +/* FIELD1 and FIELD2 are two fields of component refs. We assume
>> + that bases of both component refs are
>> + (*) are either equivalent or they point to different objects.
>
>are either equivalent(*) or not overlapping
>
>> + We do not assume that FIELD1 and FIELD2 are of same type.
>
>that the containers of FIELD1 and FIELD2 are of the same type?
>
>> +
>> + Return 0 if FIELD1 and FIELD2 satisfy (*).
>> + This is the case when their offsets are the same.
>
>Hmm, so when the offsets are the same then the bases are equivalent?
>I think you want to say
>
> Return 0 if in case the component refs satisfy (*) we
> know FIELD1 and FIELD2 are overlapping exactly.
>
>> + Return 1 if FIELD1 and FIELD2 are non-overlapping.
>> +
>> + Return -1 otherwise.
>> +
>> + Main difference between 0 and -1 is to let
>> + nonoverlapping_component_refs_since_match_p discover the
>semnatically
>
>semantically
>
>otherwise looks good now.
>
>Thanks,
>Richard.
>
>> + equivalent part of the access path.
>> +
>> + Note that this function is used even with -fno-strict-aliasing
>> + and makes use of no TBAA assumptions. */
>> +
>> +static int
>> +nonoverlapping_component_refs_p_1 (const_tree field1, const_tree
>field2)
>> +{
>> + /* If both fields are of the same type, we could save hard work of
>> + comparing offsets. */
>> + tree type1 = DECL_CONTEXT (field1);
>> + tree type2 = DECL_CONTEXT (field2);
>> +
>> + if (DECL_BIT_FIELD_REPRESENTATIVE (field1))
>> + field1 = DECL_BIT_FIELD_REPRESENTATIVE (field1);
>> + if (DECL_BIT_FIELD_REPRESENTATIVE (field2))
>> + field2 = DECL_BIT_FIELD_REPRESENTATIVE (field1);
Typo: s/field1/field2/
>> +
>> + /* ??? Bitfields can overlap at RTL level so punt on them.
>> + FIXME: RTL expansion should be fixed by adjusting the access
>path
>> + when producing MEM_ATTRs for MEMs which are wider than
>> + the bitfields similarly as done in set_mem_attrs_minus_bitpos.
>*/
>> + if (DECL_BIT_FIELD (field1) && DECL_BIT_FIELD (field2))
>> + return -1;
That's a pity.
thanks,
next prev parent reply other threads:[~2019-07-09 21:02 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-08 7:39 Jan Hubicka
2019-07-08 9:10 ` Richard Biener
2019-07-08 10:48 ` Jan Hubicka
2019-07-09 12:02 ` Jan Hubicka
2019-07-09 12:21 ` Richard Biener
2019-07-09 12:41 ` Jan Hubicka
2019-07-09 12:52 ` Richard Biener
2019-07-09 13:10 ` Jan Hubicka
2019-07-09 13:30 ` Richard Biener
2019-07-09 13:37 ` Jan Hubicka
2019-07-09 13:41 ` Richard Biener
2019-07-09 21:03 ` Bernhard Reutner-Fischer [this message]
2019-07-11 8:29 ` Rainer Orth
2019-07-16 9:30 ` Jan Hubicka
2019-07-16 11:58 ` Rainer Orth
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=45CE5AFB-5FBC-4044-91E0-B89DB1B84407@gmail.com \
--to=rep.dot.nop@gmail.com \
--cc=d@dcepelik.cz \
--cc=gcc-patches@gcc.gnu.org \
--cc=hubicka@ucw.cz \
--cc=rguenther@suse.de \
/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).