https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65679
Bug ID: 65679 Summary: Too strict alias analysis? Product: gcc Version: 4.9.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: gcc at robbertkrebbers dot nl Consider the following example: #include<stdio.h> #include<stdint.h> int main() { int x = 1, y = 2, *p = &y, *q = &x + 1; if ((intptr_t)p == (intptr_t)q) { *q = 10; printf("%d %d %d\n", x, y, p == q); } } When compiled with "gcc -pedantic -std=c99 -O2" (and even with -fno-strict-aliasing added), the compiled program prints: 1 2 0 So, despite the fact that is has been "observed" that p and q have identical representations, they are still not being treated as equal. Is this intended?