https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121277

--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Georg-Johann Lay <g...@gcc.gnu.org>:

https://gcc.gnu.org/g:089faf54fa96565784ebdd8dfcf9c350c4c3bee5

commit r16-2591-g089faf54fa96565784ebdd8dfcf9c350c4c3bee5
Author: Georg-Johann Lay <a...@gjlay.de>
Date:   Mon Jul 28 21:44:06 2025 +0200

    AVR: target/121277 - Don't load 0x800000 with const __flashx *x = NULL.

    Converting from generic AS to __flashx used the same rule like
    for __memx, which tags RAM (generic AS) locations by setting bit 23.
    The justification was that generic isn't a subset of __flashx, though
    that lead to surprises with code like const __flashx *x = NULL.

    The natural thing to do is to just load 0x000000 in that case,
    so that the null pointer works in __flashx as expected.

    Apart from that, converting NULL to __flashx (or __flash) no more
    raises a -Waddr-space-convert diagnostic.

    gcc/
            PR target/121277
            * config/avr/avr.cc (avr_addr_space_convert): When converting
            from generic AS to __flashx, don't set bit 23.
            (avr_convert_to_type): Don't -Waddr-space-convert when NULL
            is converted to __flashx or to __flash.

Reply via email to