------- Comment #1 from pluto at agmk dot net 2006-02-01 10:23 ------- It's not a gcc bug. The code relies on the results of intermediate subexpressions. According to Stroustrup, The C++ Programming Language, section 6.2.2, "The order of evaluation of subexpressions within an expression is undefined."
You should use sequence points e.g.: a ^= b, b ^= a, a ^= b; -- pluto at agmk dot net changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|A ^= B ^= A ^=B doesn't |A ^= B ^= A ^=B doesn't |work if compiled with -g |work if compiled with -g http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26060