https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108510
Martin Liška <marxin at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |RESOLVED Resolution|--- |INVALID --- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> --- (In reply to Li Shaohua from comment #2) > Sure: (compiler explorer: https://godbolt.org/z/3qEavnan5) > > % cat a.c > int a; > char b; > int *c = &a, *d; > long e; > int main() { > long *f = &e; > { > int g=0; > d = &g; > } So if c is non-zero, then we don't need to load *d here. Plus, the result of the expression is unused, so the leftmost *d does not play any role. > *d << (b = ((*f)--, c || *d)); > } > % If you change it to: *d <<= (b = ((*f)--, c || *d)); you will hit the ASAN error.