AVR: New option for strict address space subset relations
Introduces `-mstrict-addr-space-subsets` to enforce precise address space subset rules on AVR.
A new target option, -mstrict-addr-space-subsets, is introduced for the AVR architecture. This option enforces stricter address space subset relations, preventing code that attempts to access memory across unrelated spaces, such as reading from Flash as if it were RAM, unless explicitly allowed.
In Details
This patch adds the -mstrict-addr-space-subsets option to AVR target configurations. It refines the avr_addr_space_subset_p check to enforce a more accurate hierarchy of address spaces (e.g., __memx > __flashx > __flash), disallowing inter-space access that was previously permitted by a looser subset definition. This impacts how code can cast pointers between different AVR address spaces.
- AVR
- A family of microcontrollers developed by Atmel (now Microchip Technology). GCC supports targeting these microcontrollers.
- address space
- A range of memory addresses that a processor can access. Microcontrollers often have multiple, distinct address spaces (e.g., for RAM, Flash, EEPROM).
- subset relations
- In the context of address spaces, this refers to how one address space is considered a part of another. For example, a specific memory region might be a subset of a larger address space.
- mstrict-addr-space-subsets
- A GCC target option for the AVR architecture that enforces a strict hierarchy of address space subset relations.