This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 8/9] Add TARGET_ADDR_SPACE_ZERO_ADDRESS_VALID


On 10/13/2015 04:13 AM, Richard Biener wrote:
On Tue, Oct 13, 2015 at 1:27 AM, Richard Henderson <rth@redhat.com> wrote:
On 10/12/2015 09:10 PM, Richard Biener wrote:

The check_loadstore change should instead have adjusted the
flag_delete_null_pointer_checks guard in
infer_nonnull_range_by_dereference.



Nope, that doesn't work.  You have to wait until you see the actual MEM
being dereferenced before you can look at it's address space.


Well, as we are explicitely looking for the pointer 'op' we know the
address-space
beforehand, no?  TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (op)))?


No.  We don't even know what type we're looking for; we're merely looking
for any use of NULL within any memory reference within STMT.

Specifically, when we're not looking for a specific SSA_NAME (which would be
properly typed), we always pass in a plain (void *)0:

           bool by_dereference
             = infer_nonnull_range_by_dereference (stmt, null_pointer_node);

Ick.
It's just looking to see if there's an explicit *0 in stmt. That can occur due to cprop & friends obviously. It was an easy way to avoid having to write a special walker.

The problem here is we don't know what address space the *0 is going to hit, right? Isn't that also an issue for code generation as well?

Jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]