On 10/13/2015 04:13 AM, Richard Biener wrote:
On Tue, Oct 13, 2015 at 1:27 AM, Richard Henderson <r...@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

Reply via email to