This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug sanitizer/71962] error: ‘((& x) != 0u)’ is not a constant expression


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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
But we still don't want to optimize aggressively based on assumed null pointer
checks, after all, that is the whole point of the null sanitization.

Would
static inline bool
delete_null_pointer_checks_p ()
{
  return flag_delete_null_pointer_checks
         && (flag_sanitize & (SANITIZE_NULL | SANITIZE_NONNULL_ATTRIBUTE
                              | SANITIZE_RETURNS_NONNULL_ATTRIBUTE)) == 0;
}
and replacing most of flag_delete_null_pointer_checks with
delete_null_pointer_checks_p () be that bad?
Then constexpr evaluation could temporarily clear flag_sanitize (it doesn't
want any sanitization while doing constexpr folding).

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]