OSDN Git Service

2010-04-12 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / ipa.c
index c789a29..d559ab2 100644 (file)
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -1,6 +1,6 @@
 /* Basic IPA optimizations and utilities.
-   Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
-   Inc.
+   Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009, 2010
+   Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -70,6 +70,12 @@ cgraph_postorder (struct cgraph_node **order)
                    node2->aux = edge->next_caller;
                  else
                    node2->aux = &last;
+                 /* Break possible cycles involving always-inline
+                    functions by ignoring edges from always-inline
+                    functions to non-always-inline functions.  */
+                 if (edge->caller->local.disregard_inline_limits
+                     && !edge->callee->local.disregard_inline_limits)
+                   continue;
                  if (!edge->caller->aux)
                    {
                      if (!edge->caller->callers)
@@ -317,6 +323,8 @@ cgraph_externally_visible_p (struct cgraph_node *node, bool whole_program)
     return false;
   if (!whole_program)
     return true;
+  if (DECL_PRESERVE_P (node->decl))
+    return true;
   /* COMDAT functions must be shared only if they have address taken,
      otherwise we can produce our own private implementation with
      -fwhole-program.  */