https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115172
--- Comment #12 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-12 branch has been updated by Uros Bizjak <u...@gcc.gnu.org>: https://gcc.gnu.org/g:da9b7a507ef38287cc16bc88e808293019f9f531 commit r12-10477-gda9b7a507ef38287cc16bc88e808293019f9f531 Author: Jakub Jelinek <ja...@redhat.com> Date: Wed May 22 09:12:28 2024 +0200 ubsan: Use right address space for MEM_REF created for bool/enum sanitization [PR115172] The following testcase is miscompiled, because -fsanitize=bool,enum creates a MEM_REF without propagating there address space qualifiers, so what should be normally loaded using say %gs:/%fs: segment prefix isn't. Together with asan it then causes that load to be sanitized. 2024-05-22 Jakub Jelinek <ja...@redhat.com> PR sanitizer/115172 * ubsan.cc (instrument_bool_enum_load): If rhs is not in generic address space, use qualified version of utype with the right address space. Formatting fix. * gcc.dg/asan/pr115172.c: New test. (cherry picked from commit d3c506eff54fcbac389a529c2e98da108a410b7f)