OSDN Git Service

* gcc.dg/vect/costmodel/ppc/costmodel-vect-outer-fir.c: Add
[pf3gnuchains/gcc-fork.git] / gcc / tree-gimple.c
index 8f88f1d..42a29ad 100644 (file)
@@ -8,7 +8,7 @@ This file is part of GCC.
 
 GCC is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
 any later version.
 
 GCC is distributed in the hope that it will be useful,
@@ -17,9 +17,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING.  If not, write to
-the Free Software Foundation, 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA.  */
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
 
 #include "config.h"
 #include "system.h"
@@ -68,6 +67,7 @@ is_gimple_formal_tmp_rhs (tree t)
     case COMPLEX_EXPR:
     case INTEGER_CST:
     case REAL_CST:
+    case FIXED_CST:
     case STRING_CST:
     case COMPLEX_CST:
     case VECTOR_CST:
@@ -170,7 +170,7 @@ is_gimple_addressable (tree t)
    form of function invariant.  */
 
 bool
-is_gimple_min_invariant (tree t)
+is_gimple_min_invariant (const_tree t)
 {
   switch (TREE_CODE (t))
     {
@@ -179,6 +179,7 @@ is_gimple_min_invariant (tree t)
 
     case INTEGER_CST:
     case REAL_CST:
+    case FIXED_CST:
     case STRING_CST:
     case COMPLEX_CST:
     case VECTOR_CST:
@@ -201,7 +202,7 @@ is_gimple_min_invariant (tree t)
 bool
 is_gimple_stmt (tree t)
 {
-  enum tree_code code = TREE_CODE (t);
+  const enum tree_code code = TREE_CODE (t);
 
   switch (code)
     {
@@ -231,6 +232,7 @@ is_gimple_stmt (tree t)
     case OMP_PARALLEL:
     case OMP_FOR:
     case OMP_SECTIONS:
+    case OMP_SECTIONS_SWITCH:
     case OMP_SECTION:
     case OMP_SINGLE:
     case OMP_MASTER:
@@ -434,18 +436,28 @@ is_gimple_call_addr (tree t)
 /* If T makes a function call, return the corresponding CALL_EXPR operand.
    Otherwise, return NULL_TREE.  */
 
+#define GET_CALL_EXPR_IN_BODY do { \
+  /* FIXME tuples: delete the assertion below when conversion complete.  */ \
+  gcc_assert (TREE_CODE (t) != MODIFY_EXPR); \
+  if (TREE_CODE (t) == GIMPLE_MODIFY_STMT) \
+    t = GIMPLE_STMT_OPERAND (t, 1); \
+  if (TREE_CODE (t) == WITH_SIZE_EXPR) \
+    t = TREE_OPERAND (t, 0); \
+  if (TREE_CODE (t) == CALL_EXPR) \
+    return t; \
+  return NULL_TREE; \
+} while (0)
+
 tree
 get_call_expr_in (tree t)
 {
-  /* FIXME tuples: delete the assertion below when conversion complete.  */
-  gcc_assert (TREE_CODE (t) != MODIFY_EXPR);
-  if (TREE_CODE (t) == GIMPLE_MODIFY_STMT)
-    t = GIMPLE_STMT_OPERAND (t, 1);
-  if (TREE_CODE (t) == WITH_SIZE_EXPR)
-    t = TREE_OPERAND (t, 0);
-  if (TREE_CODE (t) == CALL_EXPR)
-    return t;
-  return NULL_TREE;
+  GET_CALL_EXPR_IN_BODY;
+}
+
+const_tree
+const_get_call_expr_in (const_tree t)
+{
+  GET_CALL_EXPR_IN_BODY;
 }
 
 /* Given a memory reference expression T, return its base address.