This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/66673] swapping variables via chained xor fails


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66673

--- Comment #4 from joe.carnuccio at qlogic dot com ---
if I do a ^= b ^= a ^= b it always work correctly;

doing *p ^= *q ^= *p ^= *q fails (unless -Os is used);


i.e. dereferenced pointers are being treated differently

int a = 0x32, b = 0x45;
int *p = &a, *q = &b;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]