N2260 ( http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2260.pdf ) has been integrated to C2X, according to https://gustedt.wordpress.com/2018/11/12/c2x/ . Code taken from the paper above: #include <stdio.h> void g(int **a, int *b) { *a = b; } int foo(int * restrict p, int *q) { g(&q, p); // effectively q = p *p = 1; *q = 2; return *p + *q; } int main() { int x, y; printf("%d", foo(&x, &y)); return 0; } Args: -O0 Result: 4 (correct) Args: -fno-inline -O3 Result: 3 (incorrect)
This has been fixed on the GCC 8 branch already. *** This bug has been marked as a duplicate of bug 87610 ***