https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122013
Bug ID: 122013
Summary: c-c++-common/ubsan/null-12.c fails if only using
-fsanitize=null without -fsanitize=alignment
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: sanitizer
Assignee: unassigned at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
jakub at gcc dot gnu.org, kcc at gcc dot gnu.org
Target Milestone: ---
I noticed this while trying to optimize UBSAN_NULL checks away.
in this case of optimizing away the alignment check part of
c-c++-common/ubsan/null-12.c, this testcase starts to fail but you can
reproduce the same issue with just supplying `-fsanitize=null -O1` on the
trunk.
These stmts no longer error out:
```
int *v2 = &(*s).i;
int *v3 = &s2[0]->i;
int *v4 = &s->i + 1;
```