1. A method for facilitating operation of a software transactional memory system with stack locations comprising the steps of: providing a software transactional memory system, the software transactional memory system interacting with a compiler; and if the compiler determines at compile time that a particular address for a variable in an original code segment is a stack location, that the stack location is live on entry to a current transaction scope, and that the particular address of the variable has not been taken and passed to another thread, then making a change to the original code segment, using a processing unit, in a manner that ensures failure atomicity to provide a changed original code segment; wherein the change comprises modifying the original code segment so that a shadow copy is saved for each local variable that is live on entry to the current transaction scope.