OSDN Git Service

PR middle-end/51472
authoraldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Dec 2011 14:30:07 +0000 (14:30 +0000)
committeraldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Dec 2011 14:30:07 +0000 (14:30 +0000)
        * trans-mem.c (tm_log_add): Use create_tmp_var_reg.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182588 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/gcc.dg/tm/pr51472.c [new file with mode: 0644]
gcc/trans-mem.c

index 7374a6d..c0b6d76 100644 (file)
@@ -1,3 +1,8 @@
+2011-12-21  Aldy Hernandez  <aldyh@redhat.com>
+
+       PR middle-end/51472
+       * trans-mem.c (tm_log_add): Use create_tmp_var_reg.
+
 2011-12-21  Martin Jambor  <mjambor@suse.cz>
 
        * tree-into-ssa.c (rewrite_update_stmt): Do not dump extra newlines.
diff --git a/gcc/testsuite/gcc.dg/tm/pr51472.c b/gcc/testsuite/gcc.dg/tm/pr51472.c
new file mode 100644 (file)
index 0000000..2897c3d
--- /dev/null
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O  --param tm-max-aggregate-size=32" } */
+
+typedef int __attribute__ ((vector_size (16))) vectype;
+vectype v;
+
+void
+foo (int c)
+{
+  vectype *p = __builtin_malloc (sizeof (vectype));
+  __transaction_atomic
+  {
+    *p = v;
+    if (c)
+      __transaction_cancel;
+  }
+}
index 02f8a18..c0a8b8c 100644 (file)
@@ -1003,7 +1003,7 @@ tm_log_add (basic_block entry_block, tree addr, gimple stmt)
             special constructors and the like.  */
          && !TREE_ADDRESSABLE (type))
        {
-         lp->save_var = create_tmp_var (TREE_TYPE (lp->addr), "tm_save");
+         lp->save_var = create_tmp_reg (TREE_TYPE (lp->addr), "tm_save");
          add_referenced_var (lp->save_var);
          lp->stmts = NULL;
          lp->entry_block = entry_block;