public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Richard Henderson <rth@redhat.com>
Cc: Jeff Law <law@redhat.com>, GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH 8/9] Add TARGET_ADDR_SPACE_ZERO_ADDRESS_VALID
Date: Wed, 14 Oct 2015 09:22:00 -0000	[thread overview]
Message-ID: <CAFiYyc1B+hKh-+WQ0zMQ8MepErTirXZgm-n1eJkWmGuiVXGCFQ@mail.gmail.com> (raw)
In-Reply-To: <CAFiYyc3qgmofZPxE8a71oWhPJEBf1xESinGSA_w5K2Kw8X+xGg@mail.gmail.com>

On Wed, Oct 14, 2015 at 11:19 AM, Richard Biener
<richard.guenther@gmail.com> wrote:
> On Tue, Oct 13, 2015 at 10:59 PM, Richard Henderson <rth@redhat.com> wrote:
>> On 10/14/2015 02:49 AM, Jeff Law wrote:
>>>
>>> The problem here is we don't know what address space the *0 is going to
>>> hit,
>>> right?
>>
>>
>> Correct, not before we do the walk of stmt to see what's present.
>>
>>> Isn't that also an issue for code generation as well?
>>
>>
>> What sort of problem are you thinking of?  I haven't seen one yet.
>
> The actual dereference of course has a properly address-space qualified zero.
>
> Only your walking depends on operand_equal_p to treat different address-space
> zero addresses as equal (which they are of course not ...):
>
>
> int
> operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags)
> {
> ...
>   /* Check equality of integer constants before bailing out due to
>      precision differences.  */
>   if (TREE_CODE (arg0) == INTEGER_CST && TREE_CODE (arg1) == INTEGER_CST)
>     {
>       /* Address of INTEGER_CST is not defined; check that we did not forget
>          to drop the OEP_ADDRESS_OF/OEP_CONSTANT_ADDRESS_OF flags.  */
>       gcc_checking_assert (!(flags
>                              & (OEP_ADDRESS_OF | OEP_CONSTANT_ADDRESS_OF)));
>       return tree_int_cst_equal (arg0, arg1);
>     }
>
> but only later we do
>
>       /* We cannot consider pointers to different address space equal.  */
>       if (POINTER_TYPE_P (TREE_TYPE (arg0))
>                           && POINTER_TYPE_P (TREE_TYPE (arg1))
>           && (TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (arg0)))
>               != TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (arg1)))))
>         return 0;
>
> So "fixing" that would make the walker only look for default
> address-space zero dereferences.
>
> I think we need to fix operand_equal_p anyway because 0 is clearly not
> equal to 0 (only if
> they convert to the same literal)

I think you could trigger bogus CSE of dereferences of literal addresses
from different address-spaces.

Richard.

> Richard.
>
>
>>
>> r~

  reply	other threads:[~2015-10-14  9:22 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-08  5:00 [RFA 0/9] Address space support for x86 Richard Henderson
2015-10-08  5:00 ` [PATCH 2/9] Relax ADDR_SPACE_GENERIC_P checks for default address space hooks Richard Henderson
2015-10-08 10:10   ` Richard Biener
2015-10-08  5:00 ` [PATCH 7/9] i386: Add address space for tls Richard Henderson
2015-10-08  8:30   ` Florian Weimer
2015-10-08  5:00 ` [PATCH 6/9] i386: Replace ix86_address_seg with addr_space_t Richard Henderson
2015-10-08  5:00 ` [PATCH 3/9] i386: Handle address spaces in movabs patterns Richard Henderson
2015-10-08  5:00 ` [PATCH 8/9] Add TARGET_ADDR_SPACE_ZERO_ADDRESS_VALID Richard Henderson
2015-10-08 10:20   ` Richard Biener
2015-10-09 22:13     ` Richard Henderson
2015-10-12 10:10       ` Richard Biener
2015-10-12 23:27         ` Richard Henderson
2015-10-13 10:13           ` Richard Biener
2015-10-13 15:49             ` Jeff Law
2015-10-13 20:59               ` Richard Henderson
2015-10-14  9:19                 ` Richard Biener
2015-10-14  9:22                   ` Richard Biener [this message]
2015-10-14 21:20                     ` Richard Henderson
2015-10-14 15:28                   ` Jeff Law
2015-10-14 15:22                 ` Jeff Law
2015-10-08  5:00 ` [PATCH 9/9] Fix PR 66768 Richard Henderson
2015-10-08  5:17   ` Bin.Cheng
2015-10-08  9:55     ` Bernd Schmidt
2015-10-08 10:12       ` Bin.Cheng
2015-10-08 10:25   ` Richard Biener
2015-10-08  5:00 ` [PATCH 1/9] Change default of non-overlapping address space conversion Richard Henderson
2015-10-09 10:48   ` Bernd Schmidt
2015-10-08  5:00 ` [PATCH 4/9] i386: Disallow address spaces with string insns Richard Henderson
2015-10-08  5:00 ` [PATCH 5/9] i386: Add address spaces for fs/gs segments Richard Henderson
2015-10-16 15:29   ` Paolo Bonzini
2015-10-18 23:47     ` Richard Henderson
2015-10-08 10:07 ` [RFA 0/9] Address space support for x86 Richard Biener
2015-10-09 22:13   ` Richard Henderson

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=CAFiYyc1B+hKh-+WQ0zMQ8MepErTirXZgm-n1eJkWmGuiVXGCFQ@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@redhat.com \
    --cc=rth@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).