C no longer has them. Not since a standard that’s 20 years old (C99). restrict qualifier handles that.
Unfortunately C++ committee has not included restrict in C++, but it is available in all major compilers as an extension.
C no longer has them. Not since a standard that’s 20 years old (C99). restrict qualifier handles that.
Unfortunately C++ committee has not included restrict in C++, but it is available in all major compilers as an extension.
So much so that rustc regularly has to disable their noalias annotations because its pervasive noaliasing exercises rarely used LLVM paths and leads to miscompilation. Outputting noalias is currently disabled again in IR generation[0][1].
Note from downthread comments in [1] that it's completely possible to create valid C code which miscompiles on both GCC and LLVM (though GCC has been fixed since), it's just unlikely that a regular C dev would write the mix of unrolled loops, inlined functions and restrict annotations which triggers the issue.
And my understanding's it's since been fixed in GCC.
I don't doubt for a second there will be new miscompilations discovered after that one's fixed though.