This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH v2 08/13] Add TARGET_ADDR_SPACE_ZERO_ADDRESS_VALID
- From: Richard Henderson <rth at redhat dot com>
- To: Sandra Loosemore <sandra at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org, richard dot guenther at gmail dot com
- Date: Thu, 22 Oct 2015 09:16:01 -1000
- Subject: Re: [PATCH v2 08/13] Add TARGET_ADDR_SPACE_ZERO_ADDRESS_VALID
- Authentication-results: sourceware.org; auth=none
- References: <1445376433-14658-1-git-send-email-rth at redhat dot com> <1445376433-14658-9-git-send-email-rth at redhat dot com> <56285402 dot 9050001 at codesourcery dot com>
On 10/21/2015 05:12 PM, Sandra Loosemore 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?
It's kind of like -fdelete-null-pointer-checks on a per-address-space basis.
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?
No. All three of these targets have address 0 valid in the generic address
space, so there it might be best to leave things as-is.
Are there any changes to the user documentation for
-fdelete-null-pointer-checks required?
I shouldn't think so.
r~