The "party trick" is more general than just xor, for example:
void swap(unsigned* a, unsigned* b)
{
*a = *a + *b;
*b = *a - *b;
*a = *a - *b;
}
GCC still sees through it with restrict: https://godbolt.org/z/8n3bGha3e