GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "tree.h"
#include "gimple.h"
#include "tree-pass.h"
#include "ssa.h"
#include "gimple-pretty-print.h"
#include "fold-const.h"
#include "tree-object-size.h"
#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-cfg.h"
#include "tree-dfa.h"
#include "stringpool.h"
#include "attribs.h"
#include "builtins.h"
#include "gimplify-me.h"
#include "gimplify.h"
#include "tree-ssa-dce.h"
Data Structures | |
struct | object_size_info |
struct | object_size |
Variables | |
static vec< object_size > | object_sizes [OST_END] |
static bitmap | computed [OST_END] |
static unsigned HOST_WIDE_INT | offset_limit |
static unsigned | todo |
Compute __builtin_object_size for a CALL to .ACCESS_WITH_SIZE, OBJECT_SIZE_TYPE is the second argument from __builtin_object_size. The 2nd, 3rd, and the 4th parameters of the call determine the size of the CALL: 2nd argument REF_TO_SIZE: The reference to the size of the object, 3rd argument CLASS_OF_SIZE: The size referenced by the REF_TO_SIZE represents 0: the number of bytes; 1: the number of the elements of the object type; 4th argument TYPE_OF_SIZE: A constant 0 with its TYPE being the same as the TYPE of the object referenced by REF_TO_SIZE 6th argument: A constant 0 with the pointer TYPE to the original flexible array type. The size of the element can be retrived from the TYPE of the 6th argument of the call, which is the pointer to the array type.
References boolean_type_node, build_int_cst(), build_zero_cst(), fold_build2, fold_build3, fold_convert, gcc_assert, gimple_call_arg(), gimple_call_internal_p(), integer_type_node, OST_DYNAMIC, POINTER_TYPE_P, ptr_type_node, size_binop, size_unknown(), sizetype, todo, TODO_update_ssa_only_virtuals, TREE_INT_CST_LOW, TREE_TYPE, TYPE_SIZE_UNIT, TYPE_UNSIGNED, and unshare_expr().
Referenced by call_object_size().
|
static |
Compute __builtin_object_size for PTR, which is a ADDR_EXPR. OBJECT_SIZE_TYPE is the second argument from __builtin_object_size. If unknown, return size_unknown (object_size_type).
References AGGREGATE_TYPE_P, array_ref_flexible_size_p(), bitmap_bit_p, cfun, collect_object_sizes_for(), compare_tree_int(), compute_builtin_object_size(), compute_object_offset(), computed, decl_init_size(), DECL_P, error_mark_node, gcc_assert, get_or_create_ssa_default_def(), handled_component_p(), NULL_TREE, object_sizes_get(), offset_limit, OST_MINIMUM, OST_SUBOBJECT, object_size_info::pass, RECORD_OR_UNION_TYPE_P, size_binop, size_for_offset(), size_unknown(), size_unknown_p(), size_valid_p(), SSA_NAME_VERSION, TREE_CODE, TREE_CONSTANT, tree_fits_uhwi_p(), tree_int_cst_lt(), TREE_OPERAND, TREE_TYPE, TYPE_DOMAIN, TYPE_INCLUDES_FLEXARRAY, TYPE_MAX_VALUE, and TYPE_SIZE_UNIT.
Referenced by compute_builtin_object_size(), dynamic_object_size(), expr_object_size(), and plus_stmt_object_size().
Compute __builtin_object_size for CALL, which is a GIMPLE_CALL. Handles calls to functions declared with attribute alloc_size. OBJECT_SIZE_TYPE is the second argument from __builtin_object_size. If unknown, return size_unknown (object_size_type).
References ALLOCA_FUNCTION_CODE_P, BUILT_IN_NORMAL, DECL_FUNCTION_CODE(), fold_convert, gcc_assert, gimple_call_arg(), gimple_call_builtin_p(), gimple_call_fndecl(), gimple_call_fntype(), gimple_call_num_args(), INTEGRAL_TYPE_P, is_gimple_call(), lookup_attribute(), NULL_TREE, size_binop, size_unknown(), sizetype, TREE_CHAIN, TREE_INT_CST_LOW, TREE_TYPE, TREE_VALUE, TYPE_ATTRIBUTES, and TYPE_PRECISION.
Referenced by call_object_size().
Return a MODIFY_EXPR for cases where SSA and EXPR have the same type. The TREE_VEC is returned only in case of PHI nodes.
References build2(), expr, gcc_checking_assert, sizetype, TREE_CODE, TREE_TYPE, TREE_VEC_ELT, TREE_VEC_LENGTH, and types_compatible_p().
Referenced by object_sizes_set().
|
static |
Compute object_sizes for PTR, defined to the result of a call.
References access_with_size_object_size(), alloc_object_size(), gcc_assert, gimple_call_builtin_p(), gimple_call_internal_p(), is_gimple_call(), NULL_TREE, object_size_info::object_size_type, object_sizes_set(), object_sizes_unknown_p(), object_size_info::pass, size_unknown(), size_valid_p(), SSA_NAME_VERSION, and strdup_object_size().
Referenced by collect_object_sizes_for().
|
static |
Check if some pointer we are computing object size of is being increased within a loop. If yes, assume all the SSA variables participating in that loop have minimum object sizes 0.
References check_for_plus_in_loops_1(), compare_tree_int(), object_size_info::depths, gcc_assert, gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), integer_zerop(), is_gimple_assign(), offset_limit, SSA_NAME_DEF_STMT, SSA_NAME_VERSION, object_size_info::tos, and TREE_CODE.
Referenced by compute_builtin_object_size().
|
static |
Helper function for check_for_plus_in_loops. Called recursively to detect loops.
References as_a(), bitmap_bit_p, bitmap_clear_bit(), bitmap_set_bit, check_for_plus_in_loops_1(), computed, object_size_info::depths, gcc_assert, gcc_unreachable, gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), gimple_assign_single_p(), gimple_assign_unary_nop_p(), gimple_phi_arg(), gimple_phi_num_args(), i, integer_zerop(), object_size_info::object_size_type, object_sizes_get(), object_sizes_set(), pass_through_call(), object_size_info::reexamine, size_zero_node, SSA_NAME_DEF_STMT, SSA_NAME_VERSION, object_size_info::stack, object_size_info::tos, and TREE_CODE.
Referenced by check_for_plus_in_loops(), and check_for_plus_in_loops_1().
|
static |
Compute object sizes for VAR. For ADDR_EXPR an object size is the number of remaining bytes to the end of the object (where what is considered an object depends on OSI->object_size_type). For allocation GIMPLE_CALL like malloc or calloc object size is the size of the allocation. For POINTER_PLUS_EXPR where second operand is a constant integer, object size is object size of the first operand minus the constant. If the constant is bigger than the number of remaining bytes until the end of the object, object size is 0, but if it is instead a pointer subtraction, object size is size_unknown (object_size_type). To differentiate addition from subtraction, ADDR_EXPR returns size_unknown (object_size_type) for all objects bigger than half of the address space, and constants less than half of the address space are considered addition, while bigger constants subtraction. For a memcpy like GIMPLE_CALL that always returns one of its arguments, the object size is object size of that argument. Otherwise, object size is the maximum of object sizes of variables that it might be set to.
References as_a(), bitmap_bit_p, bitmap_clear_bit(), bitmap_set_bit, call_object_size(), computed, cond_expr_object_size(), dump_file, dump_flags, expr_object_size(), gcc_unreachable, gimple_assign_rhs1(), gimple_assign_rhs_code(), gimple_assign_single_p(), gimple_assign_unary_nop_p(), gimple_phi_arg(), gimple_phi_num_args(), i, merge_object_sizes(), object_size_info::object_size_type, object_sizes_initialize(), object_sizes_set_temp(), object_sizes_unknown_p(), OST_DYNAMIC, parm_object_size(), object_size_info::pass, pass_through_call(), phi_dynamic_object_size(), plus_stmt_object_size(), POINTER_TYPE_P, print_generic_expr(), object_size_info::reexamine, size_initval(), SSA_NAME_DEF_STMT, SSA_NAME_VAR, SSA_NAME_VERSION, TDF_DETAILS, TREE_CODE, TREE_OPERAND, TREE_TYPE, unknown_object_size(), and object_size_info::visited.
Referenced by addr_object_size(), compute_builtin_object_size(), dynamic_object_size(), merge_object_sizes(), and plus_stmt_object_size().
Compute __builtin_object_size value for PTR and set *PSIZE to the resulting value. If the declared object is known and PDECL is nonnull, sets *PDECL to the object's DECL. OBJECT_SIZE_TYPE is the second argument to __builtin_object_size. Returns true on success and false when the object size could not be determined.
References addr_object_size(), BITMAP_ALLOC, bitmap_bit_p, bitmap_clear(), bitmap_copy(), bitmap_empty_p(), BITMAP_FREE, bitmap_set_bit, object_size_info::changed, check_for_plus_in_loops(), collect_object_sizes_for(), compare_tree_int(), compute_builtin_object_size(), computed, object_size_info::depths, dump_file, dump_flags, EXECUTE_IF_SET_IN_BITMAP, free(), gcc_assert, gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), gimplify_size_expressions(), i, init_offset_limit(), NULL, num_ssa_names, object_size_info::object_size_type, object_sizes_get(), object_sizes_grow(), object_sizes_unknown_p(), offset, offset_limit, OST_DYNAMIC, OST_END, OST_MINIMUM, OST_SUBOBJECT, object_size_info::pass, POINTER_TYPE_P, print_generic_expr(), object_size_info::reexamine, size_for_offset(), size_unknown(), size_unknown_p(), ssa_name, SSA_NAME_DEF_STMT, SSA_NAME_VERSION, object_size_info::stack, TDF_DETAILS, object_size_info::tos, TREE_CODE, tree_fits_shwi_p(), TREE_TYPE, and object_size_info::visited.
Referenced by addr_object_size(), compute_builtin_object_size(), early_object_sizes_execute_one(), fold_builtin_object_size(), gimple_fold_builtin_strncat(), instrument_object_size(), and strdup_object_size().
|
static |
Compute offset of EXPR within VAR. Return error_mark_node if unknown.
References array_ref_element_size(), array_ref_low_bound(), CASE_CONVERT, component_ref_field_offset(), compute_object_offset(), CONST_CAST_TREE, DECL_FIELD_BIT_OFFSET, error_mark_node, fold_build1, fold_build2, fold_convert, gcc_assert, integer_zerop(), mem_ref_offset(), size_binop, size_int, size_zero_node, sizetype, TREE_CODE, tree_int_cst_sgn(), TREE_OPERAND, tree_to_uhwi(), TREE_TYPE, TYPE_SIZE_UNIT, and wide_int_to_tree().
Referenced by addr_object_size(), and compute_object_offset().
|
static |
Compute object_sizes for VAR, defined at STMT, which is a COND_EXPR. Return true if the object size might need reexamination later.
References dynamic_object_size(), expr_object_size(), fold_build3, gcc_assert, gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs3(), gimple_assign_rhs_code(), merge_object_sizes(), object_size_info::object_size_type, object_sizes_set(), object_sizes_unknown_p(), OST_DYNAMIC, object_size_info::reexamine, size_unknown(), size_unknown_p(), sizetype, SSA_NAME_VERSION, and TREE_CODE.
Referenced by collect_object_sizes_for().
Returns the size of the object designated by DECL considering its initializer if it either has one or if it would not affect its size, otherwise the size of the object without the initializer when MIN is true, else null. An object's initializer affects the object's size if it's a struct type with a flexible array member.
References build3(), byte_position(), component_ref_size(), DECL_SIZE_UNIT, fold_build2, last, last_field(), NULL_TREE, TREE_CODE, TREE_TYPE, TYPE_SIZE, and TYPE_SIZE_UNIT.
Referenced by addr_object_size(), and handle_decl().
Dummy valueize function.
Referenced by object_sizes_execute().
|
static |
Compute the dynamic object size for VAR. Return the result in SIZE and WHOLESIZE.
References addr_object_size(), collect_object_sizes_for(), object_size_info::object_size_type, object_sizes_get(), size_unknown(), SSA_NAME_VERSION, and TREE_CODE.
Referenced by cond_expr_object_size(), and phi_dynamic_object_size().
|
static |
Attempt to fold one __builtin_dynamic_object_size call in CALL into an expression and insert it at I. Return true if it succeeds.
References as_a(), dump_file, dump_flags, EXPR_LOC_OR_LOC, fold_builtin_call_array(), gcc_assert, gimple_call_arg(), gimple_call_fn(), gimple_call_num_args(), gimple_call_return_type(), gimplify_and_update_call_from_tree(), i, input_location, print_generic_expr(), print_gimple_stmt(), STRIP_NOPS, and TDF_DETAILS.
Referenced by object_sizes_execute().
|
static |
Process a __builtin_object_size or __builtin_dynamic_object_size call in CALL early for subobjects before any object information is lost due to optimization. Insert a MIN or MAX expression of the result and __builtin_object_size at I so that it may be processed in the second pass. __builtin_dynamic_object_size is treated like __builtin_object_size here since we're only looking for constant bounds.
References compute_builtin_object_size(), fold_convert, g, gcc_assert, gimple_build_assign(), gimple_call_arg(), gimple_call_lhs(), gimple_call_set_lhs(), gsi_insert_after(), GSI_NEW_STMT, i, int_fits_type_p(), make_ssa_name(), NULL_TREE, object_size_info::object_size_type, OST_MINIMUM, TREE_CODE, tree_fits_uhwi_p(), tree_to_uhwi(), TREE_TYPE, and update_stmt().
Referenced by object_sizes_execute().
Emit PHI nodes for size expressions fo.
References add_phi_arg(), as_a(), create_phi_node(), force_gimple_operand(), gcc_checking_assert, gimple_bb(), gimple_phi_arg_edge(), gimple_phi_arg_location(), gimple_phi_num_args(), gimple_seq_add_seq(), gsi_insert_seq_on_edge(), i, NULL, TREE_CODE, TREE_VEC_ELT, and TREE_VEC_LENGTH.
Referenced by gimplify_size_expressions().
|
static |
Compute object_sizes for PTR, defined to VALUE, which is not an SSA_NAME.
References addr_object_size(), gcc_assert, object_size_info::object_size_type, object_sizes_set(), object_sizes_unknown_p(), object_size_info::pass, POINTER_TYPE_P, size_unknown(), SSA_NAME_VERSION, TREE_CODE, TREE_OPERAND, and TREE_TYPE.
Referenced by collect_object_sizes_for(), cond_expr_object_size(), and parm_object_size().
void fini_object_sizes | ( | void | ) |
Destroy data structures after the object size computation.
References BITMAP_FREE, computed, object_size_info::object_size_type, object_sizes_release(), and OST_END.
Referenced by object_sizes_execute().
|
static |
Walk through size expressions that need reexamination and generate statements for them.
References BITMAP_ALLOC, bitmap_clear_bit(), bitmap_copy(), BITMAP_FREE, bitmap_set_bit, cfun, changed, emit_phi_nodes(), ENTRY_BLOCK_PTR_FOR_FN, EXECUTE_IF_SET_IN_BITMAP, force_gimple_operand(), GSI_CONTINUE_LINKING, gsi_for_stmt(), gsi_insert_seq_before(), gsi_start_bb(), i, NULL, NULL_TREE, object_size_info::object_size_type, object_sizes_get(), object_sizes_get_raw(), object_sizes_initialize(), propagate_unknowns(), object_size_info::reexamine, release_ssa_name(), single_succ(), object_size::size, size_binop, size_unknown(), size_unknown_p(), size_usable_p(), ssa_name, SSA_NAME_DEF_STMT, SSA_NAME_VERSION, and object_size::wholesize.
Referenced by compute_builtin_object_size().
void init_object_sizes | ( | void | ) |
Initialize data structures for the object size computation.
References BITMAP_ALLOC, computed, init_offset_limit(), NULL, object_size_info::object_size_type, object_sizes_grow(), and OST_END.
Referenced by object_sizes_execute().
|
static |
Initialize OFFSET_LIMIT variable.
References offset_limit, sizetype, tree_fits_uhwi_p(), tree_to_uhwi(), and TYPE_MAX_VALUE.
Referenced by compute_builtin_object_size(), and init_object_sizes().
gimple_opt_pass * make_pass_early_object_sizes | ( | gcc::context * | ctxt | ) |
gimple_opt_pass * make_pass_object_sizes | ( | gcc::context * | ctxt | ) |
|
static |
Merge object sizes of ORIG + OFFSET into DEST. Return true if the object size might need reexamination later.
References bitmap_bit_p, object_size_info::changed, collect_object_sizes_for(), object_size_info::object_size_type, object_sizes_get(), object_sizes_set(), object_sizes_unknown_p(), object_size_info::pass, object_size_info::reexamine, and SSA_NAME_VERSION.
Referenced by collect_object_sizes_for(), and cond_expr_object_size().
References bitmap_set_bit, build_zero_cst(), builtin_decl_implicit(), do_valueize(), dump_file, dump_flags, dynamic_object_sizes_execute_one(), early_object_sizes_execute_one(), fini_object_sizes(), fold_convert, FOR_EACH_BB_FN, gcc_assert, gimple_call_arg(), gimple_call_builtin_p(), gimple_call_lhs(), gimple_call_set_fndecl(), gimple_fold_stmt_to_constant(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), i, init_object_sizes(), integer_minus_one_node, object_size_info::object_size_type, OST_END, OST_MINIMUM, print_generic_expr(), print_gimple_stmt(), replace_call_with_value(), replace_uses_by(), simple_dce_from_worklist(), size_type_node, SSA_NAME_OCCURS_IN_ABNORMAL_PHI, SSA_NAME_VERSION, TDF_DETAILS, todo, TREE_CODE, tree_fits_uhwi_p(), tree_to_uhwi(), and update_stmt().
|
inlinestatic |
Return a size tree for VARNO corresponding to OSI. If WHOLE is true, return the whole object size. Use this for building size expressions based on size of VARNO.
References gcc_checking_assert, object_size_info::object_size_type, object_sizes, OST_DYNAMIC, size_usable_p(), TREE_CODE, TREE_OPERAND, TREE_VEC_ELT, and TREE_VEC_LENGTH.
Referenced by addr_object_size(), check_for_plus_in_loops_1(), compute_builtin_object_size(), dynamic_object_size(), gimplify_size_expressions(), merge_object_sizes(), object_sizes_set_temp(), and plus_stmt_object_size().
|
inlinestatic |
Return the raw size expression for VARNO corresponding to OSI. This returns the TREE_VEC as is and should only be used during gimplification.
References gcc_assert, object_size_info::object_size_type, object_sizes, and object_size_info::pass.
Referenced by gimplify_size_expressions().
|
inlinestatic |
Grow object_sizes[OBJECT_SIZE_TYPE] to num_ssa_names.
References num_ssa_names, and object_sizes.
Referenced by compute_builtin_object_size(), and init_object_sizes().
|
inlinestatic |
Set size for VARNO corresponding to OSI to VAL.
References object_size_info::object_size_type, and object_sizes.
Referenced by collect_object_sizes_for(), and gimplify_size_expressions().
|
inlinestatic |
|
static |
Set size for VARNO corresponding to OSI to VAL if it is the new minimum or maximum. For static sizes, each element of TREE_VEC is always INTEGER_CST throughout the computation. For dynamic sizes, each element may either be a gimple variable, a MODIFY_EXPR or a TREE_VEC. The MODIFY_EXPR is for expressions that need to be gimplified. TREE_VECs are special, they're emitted only for GIMPLE_PHI and the PHI result variable is the last element of the vector.
References bitmap_bit_p, bitmap_set_bit, bundle_sizes(), changed, gcc_checking_assert, make_ssa_name(), object_size_info::object_size_type, object_sizes, OST_DYNAMIC, OST_MINIMUM, object_size_info::reexamine, object_size::size, size_binop, size_initval_p(), size_usable_p(), sizetype, SSA_NAME_DEF_STMT, TREE_CODE, tree_int_cst_compare(), and object_size::wholesize.
Referenced by call_object_size(), check_for_plus_in_loops_1(), cond_expr_object_size(), expr_object_size(), merge_object_sizes(), object_sizes_set_temp(), parm_object_size(), phi_dynamic_object_size(), plus_stmt_object_size(), and unknown_object_size().
|
inlinestatic |
Set temporary SSA names for object size and whole size to resolve dependency loops in dynamic size computation.
References make_ssa_name(), object_size_info::object_size_type, object_sizes_get(), object_sizes_set(), size_initval_p(), and sizetype.
Referenced by collect_object_sizes_for().
|
inlinestatic |
Return true if object_sizes[OBJECT_SIZE_TYPE][VARNO] is unknown.
References object_sizes, and size_unknown_p().
Referenced by call_object_size(), collect_object_sizes_for(), compute_builtin_object_size(), cond_expr_object_size(), expr_object_size(), merge_object_sizes(), plus_stmt_object_size(), and unknown_object_size().
|
static |
Find size of an object passed as a parameter to the function.
References cfun, DECL_ARGUMENTS, expr_object_size(), fold_convert, gcc_assert, get_or_create_ssa_default_def(), get_parm_access(), INTEGRAL_TYPE_P, NULL_TREE, object_size_info::object_size_type, object_sizes_set(), OST_DYNAMIC, POINTER_TYPE_P, poly_int_tree_p(), size_binop, size_unknown(), sizetype, SSA_NAME_VAR, SSA_NAME_VERSION, TREE_CHAIN, TREE_TYPE, TYPE_SIZE_UNIT, UINT_MAX, and VOID_TYPE_P.
Referenced by collect_object_sizes_for().
If object size is propagated from one of function's arguments directly to its return value, return that argument for GIMPLE_CALL statement CALL. Otherwise return NULL.
References ERF_RETURN_ARG_MASK, ERF_RETURNS_ARG, gimple_call_arg(), gimple_call_builtin_p(), gimple_call_num_args(), gimple_call_return_flags(), and NULL_TREE.
Referenced by check_for_plus_in_loops_1(), and collect_object_sizes_for().
|
static |
Compute an object size expression for VAR, which is the result of a PHI node.
References as_a(), dynamic_object_size(), EDGE_COMPLEX, ggc_free(), gimple_phi_arg_def(), gimple_phi_arg_edge(), gimple_phi_num_args(), i, make_tree_vec(), object_size_info::object_size_type, object_sizes_set(), size_unknown(), size_unknown_p(), SSA_NAME_DEF_STMT, SSA_NAME_VERSION, and TREE_VEC_ELT.
Referenced by collect_object_sizes_for().
|
static |
Compute object_sizes for VAR, defined to the result of an assignment with operator POINTER_PLUS_EXPR. Return true if the object size might need reexamination later.
References addr_object_size(), bitmap_bit_p, object_size_info::changed, collect_object_sizes_for(), compare_tree_int(), gcc_assert, gcc_checking_assert, gcc_unreachable, gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), object_size_info::object_size_type, object_sizes_get(), object_sizes_set(), object_sizes_unknown_p(), offset_limit, OST_DYNAMIC, OST_MINIMUM, object_size_info::pass, object_size_info::reexamine, size_for_offset(), size_unknown(), size_unknown_p(), size_valid_p(), SSA_NAME_VERSION, TREE_CODE, and TREE_OPERAND.
Referenced by collect_object_sizes_for().
|
static |
Descend through EXPR and return size_unknown if it uses any SSA variable object_size_set or object_size_set_temp generated, which turned out to be size_unknown, as noted in UNKNOWNS.
References bitmap_bit_p, expr, i, object_size_info::object_size_type, propagate_unknowns(), size_unknown(), size_unknown_p(), SSA_NAME_VERSION, TREE_CODE, TREE_OPERAND, TREE_VEC_ELT, and TREE_VEC_LENGTH.
Referenced by gimplify_size_expressions(), and propagate_unknowns().
|
static |
Bytes at end of the object with SZ from offset OFFSET. If WHOLESIZE is not NULL_TREE, use it to get the net offset of the pointer, which should always be positive and hence, be within OFFSET_LIMIT for valid offsets.
References compare_tree_int(), fold_build2, fold_convert, gcc_checking_assert, integer_zerop(), offset, offset_limit, size_binop, size_zero_node, sizetype, TREE_CODE, tree_int_cst_compare(), TREE_TYPE, types_compatible_p(), and useless_type_conversion_p().
Referenced by addr_object_size(), compute_builtin_object_size(), and plus_stmt_object_size().
|
inlinestatic |
Return a tree with initial value for OBJECT_SIZE_TYPE.
References OST_MINIMUM, size_zero_node, sizetype, and TYPE_MAX_VALUE.
Referenced by collect_object_sizes_for().
Return true if VAL represents an initial size for OBJECT_SIZE_TYPE.
References integer_all_onesp(), integer_zerop(), and OST_MINIMUM.
Referenced by object_sizes_set(), and object_sizes_set_temp().
|
inlinestatic |
Return a tree with unknown value for OBJECT_SIZE_TYPE.
References OST_MINIMUM, size_zero_node, sizetype, and TYPE_MAX_VALUE.
Referenced by access_with_size_object_size(), addr_object_size(), alloc_object_size(), call_object_size(), compute_builtin_object_size(), cond_expr_object_size(), dynamic_object_size(), expr_object_size(), gimplify_size_expressions(), parm_object_size(), phi_dynamic_object_size(), plus_stmt_object_size(), propagate_unknowns(), ipa_polymorphic_call_context::restrict_to_inner_class(), strdup_object_size(), and unknown_object_size().
Return true if VAL represents an unknown size for OBJECT_SIZE_TYPE.
References integer_all_onesp(), integer_zerop(), and OST_MINIMUM.
Referenced by addr_object_size(), compute_builtin_object_size(), cond_expr_object_size(), gimplify_size_expressions(), object_sizes_unknown_p(), phi_dynamic_object_size(), plus_stmt_object_size(), propagate_unknowns(), and strdup_object_size().
Return true if VAL is usable as an object size in the object_sizes vectors.
References TREE_CODE.
Referenced by gimplify_size_expressions(), object_sizes_get(), and object_sizes_set().
Return true if VAL represents a valid size for OBJECT_SIZE_TYPE.
References OST_DYNAMIC, and TREE_CODE.
Referenced by addr_object_size(), call_object_size(), plus_stmt_object_size(), and strdup_object_size().
Compute __builtin_object_size for CALL, which is a call to either BUILT_IN_STRDUP or BUILT_IN_STRNDUP; IS_STRNDUP indicates which it is. OBJECT_SIZE_TYPE is the second argument from __builtin_object_size. If unknown, return size_unknown (object_size_type).
References build_call_expr(), builtin_decl_implicit(), c_strlen(), compute_builtin_object_size(), fold_build2, get_base_address(), gimple_call_arg(), NULL_TREE, OST_MINIMUM, size_one_node, size_unknown(), size_unknown_p(), size_valid_p(), sizetype, todo, TODO_update_ssa_only_virtuals, TREE_CODE, and TREE_OPERAND.
Referenced by call_object_size().
|
static |
Compute object_sizes for PTR, defined to an unknown value.
References gcc_checking_assert, object_size_info::object_size_type, object_sizes_set(), object_sizes_unknown_p(), object_size_info::pass, size_unknown(), and SSA_NAME_VERSION.
Referenced by collect_object_sizes_for().
Bitmaps what object sizes have been computed already.
Referenced by addr_object_size(), check_for_plus_in_loops_1(), collect_object_sizes_for(), compute_builtin_object_size(), fini_object_sizes(), and init_object_sizes().
|
static |
object_sizes[0] is upper bound for the object size and number of bytes till the end of the object. object_sizes[1] is upper bound for the object size and number of bytes till the end of the subobject (innermost array or field with address taken). object_sizes[2] is lower bound for the object size and number of bytes till the end of the object and object_sizes[3] lower bound for subobject. For static object sizes, the object size and the bytes till the end of the object are both INTEGER_CST. In the dynamic case, they are finally either a gimple variable or an INTEGER_CST.
Referenced by object_sizes_get(), object_sizes_get_raw(), object_sizes_grow(), object_sizes_initialize(), object_sizes_release(), object_sizes_set(), and object_sizes_unknown_p().
|
static |
Maximum value of offset we consider to be addition.
Referenced by addr_object_size(), check_for_plus_in_loops(), compute_builtin_object_size(), init_offset_limit(), plus_stmt_object_size(), and size_for_offset().
|
static |
Tell the generic SSA updater what kind of update is needed after the pass executes.
Referenced by access_with_size_object_size(), autofdo::afdo_vpt_for_early_inline(), autofdo::auto_profile(), do_rpo_vn(), do_rpo_vn_1(), do_ssa_ccp(), autofdo::early_inline(), early_inliner(), execute_cleanup_cfg_post_optimizing(), execute_fixup_cfg(), execute_split_functions(), inline_transform(), loop_invariant_motion_in_fun(), make_forwarders_with_degenerate_phis(), move_computations_worker(), object_sizes_execute(), perform_tree_ssa_dce(), process_bb(), sink_clobbers(), sink_code_in_bb(), sink_common_stores_to_bb(), spread_components(), strdup_object_size(), tree_if_conversion(), tree_loop_unroll_and_jam(), tree_lower_complex(), vect_schedule_scc(), and vect_transform_loops().