I've reorganized the TM expansion code significantly since the last commit. I've done away with the TM_LOAD/STORE markings in favour of just using builtin functions. I'm delaying expansion of the transaction stuff until all optimizations have run; no longer need I worry about the optimizers doing something weird. I've split up the TM expansion into several passes, all gated by pass_tm_init, which arranges to elide all of the TM passes if there are no TM regions. There are placeholders for the IPA and must-alias optimization passes, and examples of how to walk the dominator tree for each TM region. All that said, while it compiles, it's not complete enough to work yet. There's some problem with the SSA update after insertting the builtins, and the code to insert the transaction-restart backedges and lower the gimple_tm_atomic nodes hasn't been reconnected. I just felt that it had been too long since a commit, and wanted to let Martin and Albert see where things are heading. Hope to have things functional again early next week. r~