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

--- Comment #39 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Uros Bizjak <u...@gcc.gnu.org>:

https://gcc.gnu.org/g:624c3bb9ff762f196852dc77233610d1cdf7d7be

commit r11-11351-g624c3bb9ff762f196852dc77233610d1cdf7d7be
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Fri Mar 22 09:23:44 2024 +0100

    ubsan: Don't -fsanitize=null instrument __seg_fs/gs pointers [PR111736]

    On x86 and avr some address spaces allow 0 pointers (on avr actually
    even generic as, but libsanitizer isn't ported to it and
    I'm not convinced we should completely kill -fsanitize=null in that
    case).
    The following patch makes sure those aren't diagnosed for -fsanitize=null,
    though they are still sanitized for -fsanitize=alignment.

    2024-03-22  Jakub Jelinek  <ja...@redhat.com>

    gcc/ChangeLog:

            PR sanitizer/111736
            * ubsan.c (ubsan_expand_null_ifn, instrument_mem_ref): Avoid
            SANITIZE_NULL instrumentation for non-generic address spaces
            for which targetm.addr_space.zero_address_valid (as) is true.

    gcc/testsuite/ChangeLog:

            * gcc.dg/ubsan/pr111736.c: New test.

    (cherry picked from commit ddd4a3ca87410886b039cc225907b4f6e650082e)

Reply via email to