Handle the "new" MEM_REF in a couple of places that were missed. The memopt-10.c test for some reason expected the restoration via logging functions. But we're saving a simple "int", so the fact that the compiler chooses a local temp variable seems a completely reasonable choice.
The memopt-14.c test doesn't really do what it intended. The variable is transaction local, so there's no reason we can't just elide the entire logging. Which is what the compiler is doing. From the history, http://comments.gmane.org/gmane.comp.gcc.patches/199664 I can't really tell what we were intending to test. I've just deleted the testcase as nonsense. Committed to the branch. r~
diff --git a/gcc/testsuite/gcc.dg/tm/memopt-10.c b/gcc/testsuite/gcc.dg/tm/memopt-10.c index 4d5acd2..0266646 100644 --- a/gcc/testsuite/gcc.dg/tm/memopt-10.c +++ b/gcc/testsuite/gcc.dg/tm/memopt-10.c @@ -22,7 +22,7 @@ int f() return p[5]; } -/* { dg-final { scan-tree-dump-times "ITM_LU" 1 "tmmark" } } */ +/* { dg-final { scan-tree-dump-times "ITM_LU" 0 "tmmark" } } */ /* { dg-final { scan-tree-dump-times "ITM_WU" 0 "tmmark" } } */ -/* { dg-final { scan-tree-dump-times "tm_save" 0 "tmmark" } } */ +/* { dg-final { scan-tree-dump-times "tm_save" 1 "tmmark" } } */ /* { dg-final { cleanup-tree-dump "tmmark" } } */ diff --git a/gcc/trans-mem.c b/gcc/trans-mem.c index 3414e74..29b429b 100644 --- a/gcc/trans-mem.c +++ b/gcc/trans-mem.c @@ -949,7 +949,7 @@ tm_log_delete (void) static bool transaction_invariant_address_p (const_tree mem, basic_block region_entry_block) { - if (TREE_CODE (mem) == INDIRECT_REF + if ((TREE_CODE (mem) == INDIRECT_REF || TREE_CODE (mem) == MEM_REF) && TREE_CODE (TREE_OPERAND (mem, 0)) == SSA_NAME) { basic_block def_bb; @@ -1433,7 +1433,7 @@ requires_barrier (basic_block entry_block, tree x, gimple stmt) switch (TREE_CODE (x)) { case INDIRECT_REF: - /* case MISALIGNED_INDIRECT_REF: */ + case MEM_REF: { enum thread_memory_type ret;