IMO it is legal but very bad.
int new_thing = thingy - (thingy + thingy);
Multiple use of volatile
variables in one expression is allowed and no warning is needed. But from the programmer's point of view, it is a very bad line of code.
Does this mean the expressions like x = volatile_var - (volatile_var +volatile_var) is undefined ? Should my compiler throw an error if thisoccurs ?
No as C standard does not say anything how those reads have to be ordered. It is left to the implementations. All known to me implementations do it the easiest way for them like in this example : https://godbolt.org/z/99498141d