summaryrefslogtreecommitdiff
path: root/gcc/ipa-inline-analysis.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-02 14:28:18 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-02 14:28:18 +0000
commitd10a25bb8b6f3e2b53d5ecbfe27fd1a37949973b (patch)
tree871d28c20325f9dbd041d7fdb47759d76fd6e9a1 /gcc/ipa-inline-analysis.c
parent3b9dd281d794c872def99b4e896a581809ebabed (diff)
downloadgcc-d10a25bb8b6f3e2b53d5ecbfe27fd1a37949973b.tar.gz
* ipa-inline-analysis.c (inline_summary_alloc): Bounds check.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179428 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-inline-analysis.c')
-rw-r--r--gcc/ipa-inline-analysis.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c
index 4e97943eb9c..8499cb57f42 100644
--- a/gcc/ipa-inline-analysis.c
+++ b/gcc/ipa-inline-analysis.c
@@ -795,13 +795,17 @@ inline_summary_alloc (void)
static void
reset_inline_edge_summary (struct cgraph_edge *e)
{
- struct inline_edge_summary *es = inline_edge_summary (e);
+ if (e->uid
+ < (int)VEC_length (inline_edge_summary_t, inline_edge_summary_vec))
+ {
+ struct inline_edge_summary *es = inline_edge_summary (e);
- es->call_stmt_size = es->call_stmt_time =0;
- if (es->predicate)
- pool_free (edge_predicate_pool, es->predicate);
- es->predicate = NULL;
- VEC_free (inline_param_summary_t, heap, es->param);
+ es->call_stmt_size = es->call_stmt_time =0;
+ if (es->predicate)
+ pool_free (edge_predicate_pool, es->predicate);
+ es->predicate = NULL;
+ VEC_free (inline_param_summary_t, heap, es->param);
+ }
}
/* We are called multiple time for given function; clear
@@ -1044,9 +1048,7 @@ inline_edge_removal_hook (struct cgraph_edge *edge, void *data ATTRIBUTE_UNUSED)
{
if (edge_growth_cache)
reset_edge_growth_cache (edge);
- if (edge->uid
- < (int)VEC_length (inline_edge_summary_t, inline_edge_summary_vec))
- reset_inline_edge_summary (edge);
+ reset_inline_edge_summary (edge);
}