3 ms·
> I guess C might be able to get away with it due to the interaction with strict aliasing rules. But not for char-typed accesses. And even for larger types, I
by comex 1y ago
> I guess C might be able to get away with it due to the interaction with strict aliasing rules.
But not for char-typed accesses. And even for larger types, I think you would have to worry about the combo of first memcpying from pointer-typed memory to integer-typed memory, then loading the integer. If you eliminate dead integer loads, then you would have to not eliminate the memcpy.
- nikic 1y agoThat's a great point. I initially thought we could assume no exposure for loads with non-pointer-compatible TBAA, but you are right that this is not correct if the memory has been laundered through memcpy.
- uecker 1y agoYou can still eliminate the memcpy of if you mark the pointer exposed at this point.