2 ms·
That's not what I meant. On an architecture where "long long" is 8 bytes, but only has a 4 byte alignment requirement, the compiler knows this, and knows that
by eqvinox 7y ago
That's not what I meant.
On an architecture where "long long" is 8 bytes, but only has a 4 byte alignment requirement, the compiler knows this, and knows that 2 pointers of type "long long * " may overlap. Therefore it would disable the optimization. (Except the pointers still aren't supposed to overlap, but...)
- bonzini 7y agoNo, it wouldn't disable the optimization, because a pointer 4 bytes into a live long long object isn't a valid pointer to another long long object that is live at the same time (even though it could abstractly be a valid pointer to long long over the life of the program). If you want to disable the optimization you can use a union (which would also be technically UB but in practice compilers document that they do the right thing).