diff options
Diffstat (limited to 'gcc/ubsan.c')
-rw-r--r-- | gcc/ubsan.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/gcc/ubsan.c b/gcc/ubsan.c index 7983c930c66..af586e395a4 100644 --- a/gcc/ubsan.c +++ b/gcc/ubsan.c @@ -626,7 +626,7 @@ ubsan_create_data (const char *name, int loccnt, const location_t *ploc, ...) bool ubsan_instrument_unreachable (gimple_stmt_iterator *gsi) { - gimple g; + gimple *g; location_t loc = gimple_location (gsi_stmt (*gsi)); if (flag_sanitize_undefined_trap_on_error) @@ -659,7 +659,7 @@ is_ubsan_builtin_p (tree t) /* Create a callgraph edge for statement STMT. */ static void -ubsan_create_edge (gimple stmt) +ubsan_create_edge (gimple *stmt) { gcall *call_stmt = dyn_cast <gcall *> (stmt); basic_block bb = gimple_bb (stmt); @@ -676,7 +676,7 @@ ubsan_create_edge (gimple stmt) bool ubsan_expand_bounds_ifn (gimple_stmt_iterator *gsi) { - gimple stmt = gsi_stmt (*gsi); + gimple *stmt = gsi_stmt (*gsi); location_t loc = gimple_location (stmt); gcc_assert (gimple_call_num_args (stmt) == 3); @@ -697,7 +697,7 @@ ubsan_expand_bounds_ifn (gimple_stmt_iterator *gsi) index = force_gimple_operand_gsi (&cond_insert_point, index, true, NULL_TREE, false, GSI_NEW_STMT); - gimple g = gimple_build_cond (GT_EXPR, index, bound, NULL_TREE, NULL_TREE); + gimple *g = gimple_build_cond (GT_EXPR, index, bound, NULL_TREE, NULL_TREE); gimple_set_location (g, loc); gsi_insert_after (&cond_insert_point, g, GSI_NEW_STMT); @@ -744,7 +744,7 @@ bool ubsan_expand_null_ifn (gimple_stmt_iterator *gsip) { gimple_stmt_iterator gsi = *gsip; - gimple stmt = gsi_stmt (gsi); + gimple *stmt = gsi_stmt (gsi); location_t loc = gimple_location (stmt); gcc_assert (gimple_call_num_args (stmt) == 3); tree ptr = gimple_call_arg (stmt, 0); @@ -755,7 +755,7 @@ ubsan_expand_null_ifn (gimple_stmt_iterator *gsip) basic_block cur_bb = gsi_bb (gsi); - gimple g; + gimple *g; if (!integer_zerop (align)) { unsigned int ptralign = get_pointer_alignment (ptr) / BITS_PER_UNIT; @@ -913,7 +913,7 @@ ubsan_expand_null_ifn (gimple_stmt_iterator *gsip) bool ubsan_expand_objsize_ifn (gimple_stmt_iterator *gsi) { - gimple stmt = gsi_stmt (*gsi); + gimple *stmt = gsi_stmt (*gsi); location_t loc = gimple_location (stmt); gcc_assert (gimple_call_num_args (stmt) == 4); @@ -922,7 +922,7 @@ ubsan_expand_objsize_ifn (gimple_stmt_iterator *gsi) tree size = gimple_call_arg (stmt, 2); tree ckind = gimple_call_arg (stmt, 3); gimple_stmt_iterator gsi_orig = *gsi; - gimple g; + gimple *g; /* See if we can discard the check. */ if (TREE_CODE (size) != INTEGER_CST @@ -1033,7 +1033,7 @@ bool ubsan_expand_vptr_ifn (gimple_stmt_iterator *gsip) { gimple_stmt_iterator gsi = *gsip; - gimple stmt = gsi_stmt (gsi); + gimple *stmt = gsi_stmt (gsi); location_t loc = gimple_location (stmt); gcc_assert (gimple_call_num_args (stmt) == 5); tree op = gimple_call_arg (stmt, 0); @@ -1043,7 +1043,7 @@ ubsan_expand_vptr_ifn (gimple_stmt_iterator *gsip) tree ckind_tree = gimple_call_arg (stmt, 4); ubsan_null_ckind ckind = (ubsan_null_ckind) tree_to_uhwi (ckind_tree); tree type = TREE_TYPE (TREE_TYPE (ckind_tree)); - gimple g; + gimple *g; basic_block fallthru_bb = NULL; if (ckind == UBSAN_DOWNCAST_POINTER) @@ -1216,7 +1216,7 @@ instrument_mem_ref (tree mem, tree base, gimple_stmt_iterator *iter, static void instrument_null (gimple_stmt_iterator gsi, bool is_lhs) { - gimple stmt = gsi_stmt (gsi); + gimple *stmt = gsi_stmt (gsi); tree t = is_lhs ? gimple_get_lhs (stmt) : gimple_assign_rhs1 (stmt); tree base = get_base_address (t); const enum tree_code code = TREE_CODE (base); @@ -1281,12 +1281,12 @@ ubsan_build_overflow_builtin (tree_code code, location_t loc, tree lhstype, static void instrument_si_overflow (gimple_stmt_iterator gsi) { - gimple stmt = gsi_stmt (gsi); + gimple *stmt = gsi_stmt (gsi); tree_code code = gimple_assign_rhs_code (stmt); tree lhs = gimple_assign_lhs (stmt); tree lhstype = TREE_TYPE (lhs); tree a, b; - gimple g; + gimple *g; /* If this is not a signed operation, don't instrument anything here. Also punt on bit-fields. */ @@ -1351,7 +1351,7 @@ instrument_si_overflow (gimple_stmt_iterator gsi) static void instrument_bool_enum_load (gimple_stmt_iterator *gsi) { - gimple stmt = gsi_stmt (*gsi); + gimple *stmt = gsi_stmt (*gsi); tree rhs = gimple_assign_rhs1 (stmt); tree type = TREE_TYPE (rhs); tree minv = NULL_TREE, maxv = NULL_TREE; @@ -1395,7 +1395,7 @@ instrument_bool_enum_load (gimple_stmt_iterator *gsi) tree lhs = gimple_assign_lhs (stmt); tree ptype = build_pointer_type (TREE_TYPE (rhs)); tree atype = reference_alias_ptr_type (rhs); - gimple g = gimple_build_assign (make_ssa_name (ptype), + gimple *g = gimple_build_assign (make_ssa_name (ptype), build_fold_addr_expr (rhs)); gimple_set_location (g, loc); gsi_insert_before (gsi, g, GSI_SAME_STMT); @@ -1603,7 +1603,7 @@ ubsan_instrument_float_cast (location_t loc, tree type, tree expr, tree arg) static void instrument_nonnull_arg (gimple_stmt_iterator *gsi) { - gimple stmt = gsi_stmt (*gsi); + gimple *stmt = gsi_stmt (*gsi); location_t loc[2]; /* infer_nonnull_range needs flag_delete_null_pointer_checks set, while for nonnull sanitization it is clear. */ @@ -1617,7 +1617,7 @@ instrument_nonnull_arg (gimple_stmt_iterator *gsi) if (POINTER_TYPE_P (TREE_TYPE (arg)) && infer_nonnull_range_by_attribute (stmt, arg)) { - gimple g; + gimple *g; if (!is_gimple_val (arg)) { g = gimple_build_assign (make_ssa_name (TREE_TYPE (arg)), arg); @@ -1685,7 +1685,7 @@ instrument_nonnull_return (gimple_stmt_iterator *gsi) basic_block then_bb, fallthru_bb; *gsi = create_cond_insert_point (gsi, true, false, true, &then_bb, &fallthru_bb); - gimple g = gimple_build_cond (EQ_EXPR, arg, + gimple *g = gimple_build_cond (EQ_EXPR, arg, build_zero_cst (TREE_TYPE (arg)), NULL_TREE, NULL_TREE); gimple_set_location (g, loc[0]); @@ -1721,7 +1721,7 @@ instrument_nonnull_return (gimple_stmt_iterator *gsi) static void instrument_object_size (gimple_stmt_iterator *gsi, bool is_lhs) { - gimple stmt = gsi_stmt (*gsi); + gimple *stmt = gsi_stmt (*gsi); location_t loc = gimple_location (stmt); tree t = is_lhs ? gimple_get_lhs (stmt) : gimple_assign_rhs1 (stmt); tree type; @@ -1783,7 +1783,7 @@ instrument_object_size (gimple_stmt_iterator *gsi, bool is_lhs) while (TREE_CODE (base) == SSA_NAME) { - gimple def_stmt = SSA_NAME_DEF_STMT (base); + gimple *def_stmt = SSA_NAME_DEF_STMT (base); if (gimple_assign_ssa_name_copy_p (def_stmt) || (gimple_assign_cast_p (def_stmt) && POINTER_TYPE_P (TREE_TYPE (gimple_assign_rhs1 (def_stmt)))) @@ -1806,7 +1806,7 @@ instrument_object_size (gimple_stmt_iterator *gsi, bool is_lhs) tree sizet; tree base_addr = base; - gimple bos_stmt = NULL; + gimple *bos_stmt = NULL; if (decl_p) base_addr = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (base)), base); @@ -1856,7 +1856,7 @@ instrument_object_size (gimple_stmt_iterator *gsi, bool is_lhs) && TREE_CODE (index) == SSA_NAME && TREE_CODE (sizet) == INTEGER_CST) { - gimple def = SSA_NAME_DEF_STMT (index); + gimple *def = SSA_NAME_DEF_STMT (index); if (is_gimple_assign (def) && gimple_assign_rhs_code (def) == BIT_AND_EXPR && TREE_CODE (gimple_assign_rhs2 (def)) == INTEGER_CST) @@ -1880,7 +1880,7 @@ instrument_object_size (gimple_stmt_iterator *gsi, bool is_lhs) GSI_SAME_STMT); tree ckind = build_int_cst (unsigned_char_type_node, is_lhs ? UBSAN_STORE_OF : UBSAN_LOAD_OF); - gimple g = gimple_build_call_internal (IFN_UBSAN_OBJECT_SIZE, 4, + gimple *g = gimple_build_call_internal (IFN_UBSAN_OBJECT_SIZE, 4, ptr, t, sizet, ckind); gimple_set_location (g, loc); gsi_insert_before (gsi, g, GSI_SAME_STMT); @@ -1946,7 +1946,7 @@ pass_ubsan::execute (function *fun) { for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi);) { - gimple stmt = gsi_stmt (gsi); + gimple *stmt = gsi_stmt (gsi); if (is_gimple_debug (stmt) || gimple_clobber_p (stmt)) { gsi_next (&gsi); |