Compile with "-O2 -fno-strict-aliasing", fails on amd64 and alpha at least. Doesn't fail with -fno-tree-vrp. Seems to be related to bug 32575. Breaks linux kernel in many places (this asm is used with prefetch instruction). struct T { void *p; } *t; int main (void) { struct T *a; a = t; asm volatile ("" : : "m" (*(unsigned long *) a)); if (a) __builtin_abort (); return 0; }
This bug is invalid because asm() does NULL pointer dereference, thus triggering undefined behavior.