Conversation

Clang and GCC already consider that broken per the standard. It was also very explicitly made to be broken in C++ already, which tends to trickle back to the C standard since it's a lot of the same people making the decisions and they reference each other as justifications.
2
I'm not arguing that what Clang and GCC currently do is correct, but I am saying that they currently do it, and that it's likely to become officially correct *because* they want to it. Type-based alias analysis is similar. They tried to allow it, and will readjust it as needed.
1
1
Type-based alias analysis is possible to specify consistently, and has clear reasons you want to do it. This provenance stuff has absolutely no motivation, because deriving pointers from ints/reprs is rare, and when you do it, you actually mean it.
2
1
The motivation for it isn't to optimize cases where the conversions are used but rather cases where they're not by being able to assume that the information isn't subtly leaked out and then used to construct an aliasing pointer somewhere else that the compiler doesn't know about.
1
It's part of why pointer comparisons are undefined between different objects and using the pointer value after free for something like a comparison is undefined. Also, conversion to int is often used in some calculations especially for `p - q` where it might otherwise overflow.
1