On Thu, Oct 22, 2015 at 5:12 AM, Sandra Loosemore
<san...@codesourcery.com> wrote:
> On 10/20/2015 03:27 PM, Richard Henderson wrote:
>>
>>
>> +@deftypefn {Target Hook} bool TARGET_ADDR_SPACE_ZERO_ADDRESS_VALID
>> (addr_space_t @var{as})
>> +Define this to modify the default handling of address 0 for the
>> +address space.  Return true if 0 should be considered a valid address.
>> +@end deftypefn
>> +
>
>
> I'm confused by this new hook.  How does it interact with
> -fdelete-null-pointer-checks?  E.g. nios2-elf defaults
> flag_delete_null_pointer_checks to 0 precisely because address 0 is
> legitimate on that target.  The avr and cr16 backends simply override
> flag_delete_null_pointer_checks.  Do backends that already frob one thing
> need to frob the other as well?  Are there any changes to the user
> documentation for -fdelete-null-pointer-checks required?

I suppose a cleanup possibility would be to get rid of that "abuse" of
flag_delete_null_pointer_checks and make all targets now defining that to zero
instead implement the hook above but for the default address-space.
And then make all places checking for flag_delete_null_pointer_checks (or
at least some) use the target hook instead.

Richard.

> -Sandra
>

Reply via email to