]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/59149 (diagnose_tm_1 calls flags_from_decl_or_type on an...
authorAldy Hernandez <aldyh@redhat.com>
Fri, 13 Dec 2013 17:50:18 +0000 (17:50 +0000)
committerAldy Hernandez <aldyh@gcc.gnu.org>
Fri, 13 Dec 2013 17:50:18 +0000 (17:50 +0000)
PR tree-optimization/59149
* calls.c (flags_from_decl_or_type): Fail on non decl or type.
* trans-mem.c (diagnose_tm_1): Do not call flags_from_decl_or_type
if no type or decl.

From-SVN: r205967

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

index a238cac62a66877762ec08a06ea627c5c39ae09a..9aeeadbec52a2ffd808fadba3ccf27d20efaae0e 100644 (file)
@@ -1,3 +1,10 @@
+2013-12-13  Aldy Hernandez  <aldyh@redhat.com>
+
+       PR tree-optimization/59149
+       * calls.c (flags_from_decl_or_type): Fail on non decl or type.
+       * trans-mem.c (diagnose_tm_1): Do not call flags_from_decl_or_type
+       if no type or decl.
+
 2013-12-13  Kenneth Zadeck  <zadeck@naturalbridge.com>
 
        * config/arc/arc.h (BITS_PER_UNIT): Removed.
index 3963bc2975475941ea90079e59bfdded0bf71fec..2226e78a48945c9296571bc5479b043f72ba4dbc 100644 (file)
@@ -769,6 +769,8 @@ flags_from_decl_or_type (const_tree exp)
              || lookup_attribute ("transaction_pure", TYPE_ATTRIBUTES (exp))))
        flags |= ECF_TM_PURE;
     }
+  else
+    gcc_unreachable ();
 
   if (TREE_THIS_VOLATILE (exp))
     {
index c9af68002ac297cf3d9e0d6ba98d79e88af98f4c..ba344887d91e13b0953c8ae94bbeaa57cdbf1ba1 100644 (file)
@@ -677,7 +677,8 @@ diagnose_tm_1 (gimple_stmt_iterator *gsi, bool *handled_ops_p,
              }
            else if (direct_call_p)
              {
-               if (flags_from_decl_or_type (fn) & ECF_TM_BUILTIN)
+               if (IS_TYPE_OR_DECL_P (fn)
+                   && flags_from_decl_or_type (fn) & ECF_TM_BUILTIN)
                  is_safe = true;
                else if (replacement)
                  {