aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-object-size.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-object-size.c')
-rw-r--r--gcc/tree-object-size.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/gcc/tree-object-size.c b/gcc/tree-object-size.c
index 48da5bd..20b9956 100644
--- a/gcc/tree-object-size.c
+++ b/gcc/tree-object-size.c
@@ -69,8 +69,8 @@ static const unsigned HOST_WIDE_INT unknown[4] = { -1, -1, 0, 0 };
static tree compute_object_offset (const_tree, const_tree);
static unsigned HOST_WIDE_INT addr_object_size (struct object_size_info *,
const_tree, int);
-static unsigned HOST_WIDE_INT alloc_object_size (const_gimple, int);
-static tree pass_through_call (const_gimple);
+static unsigned HOST_WIDE_INT alloc_object_size (const gcall *, int);
+static tree pass_through_call (const gcall *);
static void collect_object_sizes_for (struct object_size_info *, tree);
static void expr_object_size (struct object_size_info *, tree, tree);
static bool merge_object_sizes (struct object_size_info *, tree, tree,
@@ -402,7 +402,7 @@ addr_object_size (struct object_size_info *osi, const_tree ptr,
unknown[object_size_type]. */
static unsigned HOST_WIDE_INT
-alloc_object_size (const_gimple call, int object_size_type)
+alloc_object_size (const gcall *call, int object_size_type)
{
tree callee, bytes = NULL_TREE;
tree alloc_size;
@@ -465,7 +465,7 @@ alloc_object_size (const_gimple call, int object_size_type)
Otherwise return NULL. */
static tree
-pass_through_call (const_gimple call)
+pass_through_call (const gcall *call)
{
tree callee = gimple_call_fndecl (call);
@@ -679,7 +679,7 @@ expr_object_size (struct object_size_info *osi, tree ptr, tree value)
/* Compute object_sizes for PTR, defined to the result of a call. */
static void
-call_object_size (struct object_size_info *osi, tree ptr, gimple call)
+call_object_size (struct object_size_info *osi, tree ptr, gcall *call)
{
int object_size_type = osi->object_size_type;
unsigned int varno = SSA_NAME_VERSION (ptr);
@@ -976,7 +976,8 @@ collect_object_sizes_for (struct object_size_info *osi, tree var)
case GIMPLE_CALL:
{
- tree arg = pass_through_call (stmt);
+ gcall *call_stmt = as_a <gcall *> (stmt);
+ tree arg = pass_through_call (call_stmt);
if (arg)
{
if (TREE_CODE (arg) == SSA_NAME
@@ -986,7 +987,7 @@ collect_object_sizes_for (struct object_size_info *osi, tree var)
expr_object_size (osi, var, arg);
}
else
- call_object_size (osi, var, stmt);
+ call_object_size (osi, var, call_stmt);
break;
}
@@ -1112,7 +1113,8 @@ check_for_plus_in_loops_1 (struct object_size_info *osi, tree var,
case GIMPLE_CALL:
{
- tree arg = pass_through_call (stmt);
+ gcall *call_stmt = as_a <gcall *> (stmt);
+ tree arg = pass_through_call (call_stmt);
if (arg)
{
if (TREE_CODE (arg) == SSA_NAME)
@@ -1260,7 +1262,7 @@ pass_object_sizes::execute (function *fun)
continue;
init_object_sizes ();
- result = fold_call_stmt (call, false);
+ result = fold_call_stmt (as_a <gcall *> (call), false);
if (!result)
{
if (gimple_call_num_args (call) == 2