https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89124
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- We have (for a few years already) refused to inline if the callee and caller disagree on the requested (-fsanitize=address related) sanitization flags: static bool sanitize_attrs_match_for_inline_p (const_tree caller, const_tree callee) { if (!caller || !callee) return true; return ((sanitize_flags_p (SANITIZE_ADDRESS, caller) == sanitize_flags_p (SANITIZE_ADDRESS, callee)) && (sanitize_flags_p (SANITIZE_POINTER_COMPARE, caller) == sanitize_flags_p (SANITIZE_POINTER_COMPARE, callee)) && (sanitize_flags_p (SANITIZE_POINTER_SUBTRACT, caller) == sanitize_flags_p (SANITIZE_POINTER_SUBTRACT, callee))); } I guess we could make an exception and allow inlining always_inline functions that do have these enabled into a function that disables that.