https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108060
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P3 |P2 Component|sanitizer |c --- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- The frontend emits { b = -32768; a[.UBSAN_BOUNDS (0B, SAVE_EXPR <(int) b>, 7);, SAVE_EXPR <(int) b>;] = a[(int) b] | (int) c; } and appearantly expects that the side-effects of the LHS are evaluated before the side-effects of the RHS. It also doesn't look at the RHS at all, likely the instrumentation happens before GENERICizing the |= operator. I think this is a frontend mistake. The C++ frontend splits turns a[b] |= c into a[b] = a[b] | c before instrumentation.