]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/gimple-expr.h
[C++] Protect call to copy_attributes_to_builtin (PR91505)
[thirdparty/gcc.git] / gcc / gimple-expr.h
index 7f9c90d4f1b1c8725714e4233405b70944979200..1ad1432bd1702d7d6d0d1cc79695b625b49a60cd 100644 (file)
@@ -1,5 +1,5 @@
 /* Header file for gimple decl, type and expressions.
-   Copyright (C) 2013-2016 Free Software Foundation, Inc.
+   Copyright (C) 2013-2019 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -35,8 +35,8 @@ extern tree create_tmp_reg (tree, const char * = NULL);
 extern tree create_tmp_reg_fn (struct function *, tree, const char *);
 
 
-extern void extract_ops_from_tree_1 (tree, enum tree_code *, tree *, tree *,
-                                    tree *);
+extern void extract_ops_from_tree (tree, enum tree_code *, tree *, tree *,
+                                  tree *);
 extern void gimple_cond_get_ops_from_tree (tree, enum tree_code *, tree *,
                                           tree *);
 extern bool is_gimple_lvalue (tree);
@@ -105,11 +105,7 @@ static inline bool
 virtual_operand_p (tree op)
 {
   if (TREE_CODE (op) == SSA_NAME)
-    {
-      op = SSA_NAME_VAR (op);
-      if (!op)
-       return false;
-    }
+    return SSA_NAME_IS_VIRTUAL_OPERAND (op);
 
   if (TREE_CODE (op) == VAR_DECL)
     return VAR_DECL_IS_VIRTUAL_OPERAND (op);
@@ -123,6 +119,7 @@ static inline bool
 is_gimple_addressable (tree t)
 {
   return (is_gimple_id (t) || handled_component_p (t)
+         || TREE_CODE (t) == TARGET_MEM_REF
          || TREE_CODE (t) == MEM_REF);
 }
 
@@ -134,6 +131,7 @@ is_gimple_constant (const_tree t)
   switch (TREE_CODE (t))
     {
     case INTEGER_CST:
+    case POLY_INT_CST:
     case REAL_CST:
     case FIXED_CST:
     case COMPLEX_CST:
@@ -146,15 +144,15 @@ is_gimple_constant (const_tree t)
     }
 }
 
-/* A wrapper around extract_ops_from_tree_1, for callers which expect
-   to see only a maximum of two operands.  */
+/* A wrapper around extract_ops_from_tree with 3 ops, for callers which
+   expect to see only a maximum of two operands.  */
 
 static inline void
 extract_ops_from_tree (tree expr, enum tree_code *code, tree *op0,
                       tree *op1)
 {
   tree op2;
-  extract_ops_from_tree_1 (expr, code, op0, op1, &op2);
+  extract_ops_from_tree (expr, code, op0, op1, &op2);
   gcc_assert (op2 == NULL_TREE);
 }