7. A computer program product, comprising one or more computer readable hardware storage devices having computer readable program instructions stored therein, said program instructions executable by one or more processors of a computer system 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.
7. A computer program product, comprising one or more computer readable hardware storage devices having computer readable program instructions stored therein, said program instructions executable by one or more processors of a computer system 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. 10. The computer program product of claim 7 , wherein said commoning all remaining expressions that are not volatile expressions in the second pass comprises: analyzing each extended basic block in the program using the set of predetermined criteria in the second pass, to common all expressions that are not volatile including local variables and final fields, wherein no volatile fields are commoned in the second pass.