aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/cgraph.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/cgraph.c')
-rw-r--r--gcc-4.9/gcc/cgraph.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/cgraph.c b/gcc-4.9/gcc/cgraph.c
index 63b7b4d60..532d09b28 100644
--- a/gcc-4.9/gcc/cgraph.c
+++ b/gcc-4.9/gcc/cgraph.c
@@ -64,6 +64,7 @@ along with GCC; see the file COPYING3. If not see
#include "gimple-pretty-print.h"
#include "expr.h"
#include "tree-dfa.h"
+#include "opts.h"
/* FIXME: Only for PROP_loops, but cgraph shouldn't have to know about this. */
#include "tree-pass.h"
@@ -546,6 +547,7 @@ cgraph_create_node (tree decl)
node->next_nested = node->origin->nested;
node->origin->nested = node;
}
+ pattern_match_function_attributes (decl);
return node;
}
@@ -2462,6 +2464,11 @@ cgraph_can_remove_if_no_direct_calls_and_refs_p (struct cgraph_node *node)
/* Extern inlines can always go, we will use the external definition. */
if (DECL_EXTERNAL (node->decl))
return true;
+ /* Aux functions are safe to remove, but only once static promotion is
+ complete since they may affect promoted names if they are the context
+ for any static variables. */
+ if (cgraph_pre_profiling_inlining_done && cgraph_is_aux_decl_external (node))
+ return true;
/* When function is needed, we can not remove it. */
if (node->force_output || node->used_from_other_partition)
return false;