OSDN Git Service

Revert * trans-mem.c (requires_barrier): Do not instrument thread local
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 25 Jan 2012 20:35:34 +0000 (20:35 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 25 Jan 2012 20:35:34 +0000 (20:35 +0000)
variables and emit save/restore for them.

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

gcc/ChangeLog
gcc/testsuite/gcc.dg/tm/threadlocal-1.c [deleted file]
gcc/trans-mem.c

index a044b13..338e038 100644 (file)
@@ -1,3 +1,9 @@
+2012-01-26  Richard Henderson  <rth@redhat.com>
+
+       Revert 2012-01-24 change:
+       * trans-mem.c (requires_barrier): Do not instrument thread local
+       variables and emit save/restore for them.
+
 2012-01-25  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/51986
diff --git a/gcc/testsuite/gcc.dg/tm/threadlocal-1.c b/gcc/testsuite/gcc.dg/tm/threadlocal-1.c
deleted file mode 100644 (file)
index 83a90ff..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fgnu-tm -O -fdump-tree-tmedge" } */
-__thread int notshared = 0;
-int shared = 0;
-
-int main()
-{
-  __transaction_atomic
-    {
-      notshared++;
-      shared++;
-    }
-  return notshared + shared;
-}
-/* { dg-final { scan-tree-dump-times "tm_save.\[0-9_\]+ = notshared" 1 "tmedge" } } */
-/* { dg-final { scan-tree-dump-times "notshared = tm_save" 1 "tmedge" } } */
-/* { dg-final { cleanup-tree-dump "tmedge" } } */
index 06b1d81..de7a913 100644 (file)
@@ -1,5 +1,5 @@
 /* Passes for transactional memory support.
-   Copyright (C) 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 
    This file is part of GCC.
 
@@ -1488,18 +1488,7 @@ requires_barrier (basic_block entry_block, tree x, gimple stmt)
        }
 
       if (is_global_var (x))
-       {
-         if (DECL_THREAD_LOCAL_P (x))
-           goto thread_local;
-         if (DECL_HAS_VALUE_EXPR_P (x))
-           {
-             tree value = get_base_address (DECL_VALUE_EXPR (x));
-
-             if (value && DECL_P (value) && DECL_THREAD_LOCAL_P (value))
-               goto thread_local;
-           }
-         return !TREE_READONLY (x);
-       }
+       return !TREE_READONLY (x);
       if (/* FIXME: This condition should actually go below in the
             tm_log_add() call, however is_call_clobbered() depends on
             aliasing info which is not available during
@@ -1509,14 +1498,17 @@ requires_barrier (basic_block entry_block, tree x, gimple stmt)
             lower_sequence_tm altogether.  */
          needs_to_live_in_memory (x))
        return true;
-    thread_local:
-      /* For local memory that doesn't escape (aka thread private memory), 
-        we can either save the value at the beginning of the transaction and
-        restore on restart, or call a tm function to dynamically save and
-        restore on restart (ITM_L*). */
-      if (stmt)
-       tm_log_add (entry_block, orig, stmt);
-      return false;
+      else
+       {
+         /* For local memory that doesn't escape (aka thread private
+            memory), we can either save the value at the beginning of
+            the transaction and restore on restart, or call a tm
+            function to dynamically save and restore on restart
+            (ITM_L*).  */
+         if (stmt)
+           tm_log_add (entry_block, orig, stmt);
+         return false;
+       }
 
     default:
       return false;