17. The computer system of claim 13 , wherein a volatile expression that is a static field or an instance field dependent solely on local variables or final fields can be commoned within a scope of an extended block per the particular memory model when (i) there is no other volatile expression in between and (ii) remaining predetermined conditions for commoning are also satisfied.
13. A computer system, comprising one or more processors, one or more memories, and one or more computer readable hardware storage devices, said one or more hardware storage device containing program instructions executable by the one or more processors via the one or more memories to implement a method for enhanced local commoning optimization of compilation of a program, said method comprising: performing, by the one or more processors, commoning of volatiles within an extended block for a particular memory model associated with a particular programming language, using a two pass approach by: determining, by the one or more processors, within a first pass, where in the program to evaluate volatile expressions that can be commoned; and commoning, by the one or more processors, in a second pass, all remaining expressions that are not volatile expressions.