OSDN Git Service

* config/arc/arc.h (LIB_SPEC): Define.
[pf3gnuchains/gcc-fork.git] / gcc / tree-stdarg.c
index 8401747..5c9b35c 100644 (file)
@@ -26,7 +26,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree.h"
 #include "function.h"
 #include "langhooks.h"
-#include "diagnostic.h"
 #include "gimple-pretty-print.h"
 #include "target.h"
 #include "tree-flow.h"
@@ -513,7 +512,7 @@ check_all_va_list_escapes (struct stdarg_info *si)
                  enum tree_code rhs_code = gimple_assign_rhs_code (stmt);
 
                  /* x = *ap_temp;  */
-                 if (gimple_assign_rhs_code (stmt) == INDIRECT_REF
+                 if (gimple_assign_rhs_code (stmt) == MEM_REF
                      && TREE_OPERAND (rhs, 0) == use
                      && TYPE_SIZE_UNIT (TREE_TYPE (rhs))
                      && host_integerp (TYPE_SIZE_UNIT (TREE_TYPE (rhs)), 1)
@@ -523,6 +522,7 @@ check_all_va_list_escapes (struct stdarg_info *si)
                      tree access_size = TYPE_SIZE_UNIT (TREE_TYPE (rhs));
 
                      gpr_size = si->offsets[SSA_NAME_VERSION (use)]
+                                + tree_low_cst (TREE_OPERAND (rhs, 1), 0)
                                 + tree_low_cst (access_size, 1);
                      if (gpr_size >= VA_LIST_MAX_GPR_SIZE)
                        cfun->va_list_gpr_size = VA_LIST_MAX_GPR_SIZE;
@@ -636,7 +636,6 @@ execute_optimize_stdarg (void)
              break;
              /* If old style builtins are used, don't optimize anything.  */
            case BUILT_IN_SAVEREGS:
-           case BUILT_IN_ARGS_INFO:
            case BUILT_IN_NEXT_ARG:
              va_list_escapes = true;
              continue;