]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR middle-end/52047
authoraldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 6 Feb 2012 14:42:07 +0000 (14:42 +0000)
committeraldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 6 Feb 2012 14:42:07 +0000 (14:42 +0000)
        * trans-mem.c (expand_call_tm): Add an assertion.
        * calls.c (flags_from_decl_or_type): Add ECF_TM_PURE to 'no vops'
        functions.

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

gcc/ChangeLog
gcc/calls.c
gcc/trans-mem.c

index 97ceef1d05f768b10fde10cb190af4fdeb2a22a4..bf5e93b3f783b983f96dfd3024d5e515a4c6ad84 100644 (file)
@@ -1,3 +1,10 @@
+2012-02-06  Patrick Marlier  <patrick.marlier@gmail.com>
+
+       PR middle-end/52047
+       * trans-mem.c (expand_call_tm): Add an assertion.
+       * calls.c (flags_from_decl_or_type): Add ECF_TM_PURE to 'no vops'
+       functions.
+
 2012-02-06  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/50955
index 53c033547268243ad4a7c13a2f3debe84e6106cc..19b2bfad81aa86da6b41ea7b9223c7d6b9358e86 100644 (file)
@@ -716,7 +716,7 @@ flags_from_decl_or_type (const_tree exp)
        {
          if (is_tm_builtin (exp))
            flags |= ECF_TM_BUILTIN;
-         else if ((flags & ECF_CONST) != 0
+         else if ((flags & (ECF_CONST|ECF_NOVOPS)) != 0
                   || lookup_attribute ("transaction_pure",
                                        TYPE_ATTRIBUTES (TREE_TYPE (exp))))
            flags |= ECF_TM_PURE;
index de7a913be66bf63e5c634995aaee4e87dcd2add4..d760db34b2aee0a44674659e72fe63c5940a65b3 100644 (file)
@@ -1,5 +1,5 @@
 /* Passes for transactional memory support.
-   Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
 
    This file is part of GCC.
 
@@ -2267,6 +2267,8 @@ expand_call_tm (struct tm_region *region,
     }
 
   node = cgraph_get_node (fn_decl);
+  /* All calls should have cgraph here. */
+  gcc_assert (node);
   if (node->local.tm_may_enter_irr)
     transaction_subcode_ior (region, GTMA_MAY_ENTER_IRREVOCABLE);