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

A.2.177 –xsafe=mem

SPARC: Allows the compiler to assume that no memory protection violations occur.

This option allows the compiler to use the non-faulting load instruction in the SPARC V9 architecture.

A.2.177.1 Interactions

This option takes effect only when used with optimization level -xO5 and one of the following -xarch values: sparc, sparcvis, or sparcvis2 for both -m32 and -m64.

A.2.177.2 Warnings

Because non-faulting loads do not cause a trap when a fault such as address misalignment or segmentation violation occurs, you should use this option only for programs in which such faults cannot occur. Because few programs incur memory-based traps, you can safely use this option for most programs. Do not use this option for programs that explicitly depend on memory-based traps to handle exceptional conditions.