Sun Studio 12 Update 1: C++ User's Guide

A.2.64 –O

The -O macro now expands to -xO3 instead of -xO2.

The change in default yields higher run-time performance. However, -xO3 may be inappropriate for programs that rely on all variables being automatically considered volatile. Typical programs that might have this assumption are device drivers and older multi-threaded applications that implement their own synchronization primitives. The work around is to compile with -xO2 instead of -O.