diff options
author | Georg-Johann Lay <avr@gjlay.de> | 2016-07-20 13:50:31 +0000 |
---|---|---|
committer | Georg-Johann Lay <gjl@gcc.gnu.org> | 2016-07-20 13:50:31 +0000 |
commit | 2d06ca74a23cc87d2edc983f24a196a815af1c01 (patch) | |
tree | ce0abd1f7dce44f3b5e61e8e4daa5a6b41940f05 /gcc/config/avr/avr-c.c | |
parent | b25ea150b6d2b9021f785ce4397e0ffe478b5a42 (diff) | |
download | gcc-2d06ca74a23cc87d2edc983f24a196a815af1c01.zip gcc-2d06ca74a23cc87d2edc983f24a196a815af1c01.tar.gz gcc-2d06ca74a23cc87d2edc983f24a196a815af1c01.tar.bz2 |
avr-protos.h (avr_addr_space_supported_p): New prototype.
gcc/
* config/avr/avr-protos.h (avr_addr_space_supported_p): New prototype.
* config/avr/avr.c (TARGET_ADDR_SPACE_DIAGNOSE_USAGE): New hook
define...
(avr_addr_space_diagnose_usage): ...and implementation.
(avr_addr_space_supported_p): New function.
(avr_nonconst_pointer_addrspace, avr_pgm_check_var_decl): Only
report bad address space usage if that space is supported.
(avr_insert_attributes): Same. No more complain about unsupported
address spaces.
* config/avr/avr-c.c (tm_p.h): Include it.
(avr_cpu_cpp_builtins): Only define addr-space related built-in
macro if avr_addr_space_supported_p.
From-SVN: r238519
Diffstat (limited to 'gcc/config/avr/avr-c.c')
-rw-r--r-- | gcc/config/avr/avr-c.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/config/avr/avr-c.c b/gcc/config/avr/avr-c.c index 440e801..a338a9f 100644 --- a/gcc/config/avr/avr-c.c +++ b/gcc/config/avr/avr-c.c @@ -26,7 +26,7 @@ #include "c-family/c-common.h" #include "stor-layout.h" #include "langhooks.h" - +#include "tm_p.h" /* IDs for all the AVR builtins. */ @@ -253,7 +253,10 @@ avr_register_target_pragmas (void) gcc_assert (ADDR_SPACE_GENERIC == ADDR_SPACE_RAM); /* Register address spaces. The order must be the same as in the respective - enum from avr.h (or designated initializers must be used in avr.c). */ + enum from avr.h (or designated initializers must be used in avr.c). + We always register all address spaces even if some of them make no + sense for some targets. Diagnose for non-supported spaces will be + emit by TARGET_ADDR_SPACE_DIAGNOSE_USAGE. */ for (i = 0; i < ADDR_SPACE_COUNT; i++) { @@ -391,10 +394,7 @@ avr_cpu_cpp_builtins (struct cpp_reader *pfile) /* Only supply __FLASH<n> macro if the address space is reasonable for this target. The address space qualifier itself is still supported, but using it will throw an error. */ - && avr_addrspace[i].segment < avr_n_flash - /* Only support __MEMX macro if we have LPM. */ - && (AVR_HAVE_LPM || avr_addrspace[i].pointer_size <= 2)) - + && avr_addr_space_supported_p ((addr_space_t) i)) { const char *name = avr_addrspace[i].name; char *Name = (char*) alloca (1 + strlen (name)); |