OSDN Git Service

PR target/32335
[pf3gnuchains/gcc-fork.git] / gcc / tree-stdarg.c
index b49526d..0c0d259 100644 (file)
@@ -149,11 +149,11 @@ va_list_counter_bump (struct stdarg_info *si, tree counter, tree rhs,
 
       stmt = SSA_NAME_DEF_STMT (lhs);
 
-      if (TREE_CODE (stmt) != MODIFY_EXPR
-         || TREE_OPERAND (stmt, 0) != lhs)
+      if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT
+         || GIMPLE_STMT_OPERAND (stmt, 0) != lhs)
        return (unsigned HOST_WIDE_INT) -1;
 
-      rhs = TREE_OPERAND (stmt, 1);
+      rhs = GIMPLE_STMT_OPERAND (stmt, 1);
       if (TREE_CODE (rhs) == WITH_SIZE_EXPR)
        rhs = TREE_OPERAND (rhs, 0);
 
@@ -171,7 +171,8 @@ va_list_counter_bump (struct stdarg_info *si, tree counter, tree rhs,
          continue;
        }
 
-      if (TREE_CODE (rhs) == PLUS_EXPR
+      if ((TREE_CODE (rhs) == POINTER_PLUS_EXPR
+          || TREE_CODE (rhs) == PLUS_EXPR)
          && TREE_CODE (TREE_OPERAND (rhs, 0)) == SSA_NAME
          && TREE_CODE (TREE_OPERAND (rhs, 1)) == INTEGER_CST
          && host_integerp (TREE_OPERAND (rhs, 1), 1))
@@ -211,7 +212,7 @@ va_list_counter_bump (struct stdarg_info *si, tree counter, tree rhs,
 
       stmt = SSA_NAME_DEF_STMT (lhs);
 
-      rhs = TREE_OPERAND (stmt, 1);
+      rhs = GIMPLE_STMT_OPERAND (stmt, 1);
       if (TREE_CODE (rhs) == WITH_SIZE_EXPR)
        rhs = TREE_OPERAND (rhs, 0);
 
@@ -229,7 +230,8 @@ va_list_counter_bump (struct stdarg_info *si, tree counter, tree rhs,
          continue;
        }
 
-      if (TREE_CODE (rhs) == PLUS_EXPR
+      if ((TREE_CODE (rhs) == POINTER_PLUS_EXPR
+          || TREE_CODE (rhs) == PLUS_EXPR)
          && TREE_CODE (TREE_OPERAND (rhs, 0)) == SSA_NAME
          && TREE_CODE (TREE_OPERAND (rhs, 1)) == INTEGER_CST
          && host_integerp (TREE_OPERAND (rhs, 1), 1))
@@ -447,10 +449,11 @@ check_va_list_escapes (struct stdarg_info *si, tree lhs, tree rhs)
   if (! POINTER_TYPE_P (TREE_TYPE (rhs)))
     return;
 
-  if ((TREE_CODE (rhs) == PLUS_EXPR
-       && TREE_CODE (TREE_OPERAND (rhs, 1)) == INTEGER_CST)
-      || TREE_CODE (rhs) == NOP_EXPR
-      || TREE_CODE (rhs) == CONVERT_EXPR)
+ if (((TREE_CODE (rhs) == POINTER_PLUS_EXPR
+       || TREE_CODE (rhs) == PLUS_EXPR)
+      && TREE_CODE (TREE_OPERAND (rhs, 1)) == INTEGER_CST)
+     || TREE_CODE (rhs) == NOP_EXPR
+     || TREE_CODE (rhs) == CONVERT_EXPR)
     rhs = TREE_OPERAND (rhs, 0);
 
   if (TREE_CODE (rhs) != SSA_NAME
@@ -522,10 +525,10 @@ check_all_va_list_escapes (struct stdarg_info *si)
                                  DECL_UID (SSA_NAME_VAR (use))))
                continue;
 
-             if (TREE_CODE (stmt) == MODIFY_EXPR)
+             if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
                {
-                 tree lhs = TREE_OPERAND (stmt, 0);
-                 tree rhs = TREE_OPERAND (stmt, 1);
+                 tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
+                 tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
 
                  if (TREE_CODE (rhs) == WITH_SIZE_EXPR)
                    rhs = TREE_OPERAND (rhs, 0);
@@ -555,7 +558,7 @@ check_all_va_list_escapes (struct stdarg_info *si)
                     other_ap_temp = (some_type *) ap_temp;
                     ap = ap_temp;
                     statements.  */
-                 if ((TREE_CODE (rhs) == PLUS_EXPR
+                 if ((TREE_CODE (rhs) == POINTER_PLUS_EXPR
                       && TREE_CODE (TREE_OPERAND (rhs, 1)) == INTEGER_CST)
                      || TREE_CODE (rhs) == NOP_EXPR
                      || TREE_CODE (rhs) == CONVERT_EXPR)
@@ -603,7 +606,7 @@ gate_optimize_stdarg (void)
 
 /* Entry point to the stdarg optimization pass.  */
 
-static void
+static unsigned int
 execute_optimize_stdarg (void)
 {
   basic_block bb;
@@ -660,7 +663,7 @@ execute_optimize_stdarg (void)
            }
 
          si.va_start_count++;
-         ap = TREE_VALUE (TREE_OPERAND (call, 1));
+         ap = CALL_EXPR_ARG (call, 0);
 
          if (TREE_CODE (ap) != ADDR_EXPR)
            {
@@ -807,10 +810,10 @@ execute_optimize_stdarg (void)
                continue;
            }
 
-         if (TREE_CODE (stmt) == MODIFY_EXPR)
+         if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
            {
-             tree lhs = TREE_OPERAND (stmt, 0);
-             tree rhs = TREE_OPERAND (stmt, 1);
+             tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
+             tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
 
              if (TREE_CODE (rhs) == WITH_SIZE_EXPR)
                rhs = TREE_OPERAND (rhs, 0);
@@ -903,6 +906,7 @@ finish:
        fprintf (dump_file, "%d", cfun->va_list_fpr_size);
       fputs (" FPR units.\n", dump_file);
     }
+  return 0;
 }