https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49330
--- Comment #28 from Alexander Cherepanov <ch3root at openwall dot com> --- I see the same even with pure pointers. I guess RTL doesn't care about such differences but it means the problem could bite a relatively innocent code. ---------------------------------------------------------------------- #include <stdio.h> __attribute__((noipa)) // imagine it in a separate TU static int *opaque(int *p) { return p; } int main() { static int x, y; int *r = opaque(&x) + (opaque(&y) - &y); x = 1; *r = 2; printf("x = %d\n", x); } ---------------------------------------------------------------------- $ gcc -std=c11 -pedantic -Wall -Wextra test.c && ./a.out x = 2 $ gcc -std=c11 -pedantic -Wall -Wextra -O3 test.c && ./a.out x = 1 ---------------------------------------------------------------------- gcc x86-64 version: gcc (GCC) 10.0.0 20191230 (experimental) ----------------------------------------------------------------------