volatile struct { int x, y; } s; int foo() { return (s.x > s.y); // undefined behavior: // the order of volatile accesses // is undefined in this statment }
Confirmed.
I see no undefined behavior here. The order is unspecified, not undefined, and there is nothing more wrong with accessing two volatile objects between sequence points than there would be in (s.x = 1) + (s.y = 2) modifying both objects (volatile or not) without an intervening sequence point.