OSDN Git Service

2010-04-15 Thomas Schwinge <tschwinge@gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / tree-stdarg.c
index 4e030b1..8401747 100644 (file)
@@ -1,5 +1,6 @@
 /* Pass computing data for optimizing stdarg functions.
-   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005, 2007, 2008, 2009, 2010
+   Free Software Foundation, Inc.
    Contributed by Jakub Jelinek <jakub@redhat.com>
 
 This file is part of GCC.
@@ -26,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "function.h"
 #include "langhooks.h"
 #include "diagnostic.h"
+#include "gimple-pretty-print.h"
 #include "target.h"
 #include "tree-flow.h"
 #include "tree-pass.h"
@@ -496,6 +498,9 @@ check_all_va_list_escapes (struct stdarg_info *si)
          tree use;
          ssa_op_iter iter;
 
+         if (is_gimple_debug (stmt))
+           continue;
+
          FOR_EACH_SSA_TREE_OPERAND (use, stmt, iter, SSA_OP_ALL_USES)
            {
              if (! bitmap_bit_p (si->va_list_escape_vars,
@@ -837,6 +842,8 @@ execute_optimize_stdarg (void)
                    continue;
                }
            }
+         else if (is_gimple_debug (stmt))
+           continue;
 
          /* All other uses of va_list are either va_copy (that is not handled
             in this optimization), taking address of va_list variable or