This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug sanitizer/71962] error: ‘((& x) != 0u)’ is not a constant expression
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 22 Jul 2016 11:30:41 +0000
- Subject: [Bug sanitizer/71962] error: ‘((& x) != 0u)’ is not a constant expression
- Auto-submitted: auto-generated
- References: <bug-71962-4@http.gcc.gnu.org/bugzilla/>
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).