/* Interprocedural analyses.
- Copyright (C) 2005, 2007, 2008, 2009, 2010, 2011
+ Copyright (C) 2005, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
This file is part of GCC.
continue;
fprintf (f, " callsite %s/%i -> %s/%i : \n",
- cgraph_node_name (node), node->uid,
- cgraph_node_name (cs->callee), cs->callee->uid);
+ xstrdup (cgraph_node_name (node)), node->uid,
+ xstrdup (cgraph_node_name (cs->callee)), cs->callee->uid);
ipa_print_node_jump_functions_for_edge (f, cs);
}
if (!flag_devirtualize || !gimple_vuse (call))
return false;
- ao.ref = arg;
+ ao_ref_init (&ao, arg);
ao.base = base;
ao.offset = offset;
ao.size = POINTER_SIZE;
ao.max_size = ao.size;
- ao.ref_alias_set = -1;
- ao.base_alias_set = -1;
tci.offset = offset;
tci.object = get_base_address (arg);
|| is_global_var (base))
return;
- if (detect_type_change (op, base, call, jfunc, offset)
- || !TYPE_BINFO (TREE_TYPE (base)))
+ if (!TYPE_BINFO (TREE_TYPE (base))
+ || detect_type_change (op, base, call, jfunc, offset))
return;
jfunc->type = IPA_JF_KNOWN_TYPE;
fprintf (dump_file, "ipa-prop: Discovered %s call to a known target "
"(%s/%i -> %s/%i), for stmt ",
ie->indirect_info->polymorphic ? "a virtual" : "an indirect",
- cgraph_node_name (ie->caller), ie->caller->uid,
- cgraph_node_name (ie->callee), ie->callee->uid);
+ xstrdup (cgraph_node_name (ie->caller)), ie->caller->uid,
+ xstrdup (cgraph_node_name (ie->callee)), ie->callee->uid);
if (ie->call_stmt)
print_gimple_stmt (dump_file, ie->call_stmt, 2, TDF_SLIM);
else
}
}
- expr = fold_build2_loc (loc, MEM_REF, adj->type, base, off);
- if (adj->by_ref)
- expr = build_fold_addr_expr (expr);
+ if (!adj->by_ref)
+ {
+ tree type = adj->type;
+ unsigned int align;
+ unsigned HOST_WIDE_INT misalign;
+ align = get_pointer_alignment_1 (base, &misalign);
+ misalign += (double_int_sext (tree_to_double_int (off),
+ TYPE_PRECISION (TREE_TYPE (off))).low
+ * BITS_PER_UNIT);
+ misalign = misalign & (align - 1);
+ if (misalign != 0)
+ align = (misalign & -misalign);
+ if (align < TYPE_ALIGN (type))
+ type = build_aligned_type (type, align);
+ expr = fold_build2_loc (loc, MEM_REF, type, base, off);
+ }
+ else
+ {
+ expr = fold_build2_loc (loc, MEM_REF, adj->type, base, off);
+ expr = build_fold_addr_expr (expr);
+ }
expr = force_gimple_operand_gsi (&gsi, expr,
adj->by_ref
{
const struct lto_function_header *header =
(const struct lto_function_header *) data;
- const int32_t cfg_offset = sizeof (struct lto_function_header);
- const int32_t main_offset = cfg_offset + header->cfg_size;
- const int32_t string_offset = main_offset + header->main_size;
+ const int cfg_offset = sizeof (struct lto_function_header);
+ const int main_offset = cfg_offset + header->cfg_size;
+ const int string_offset = main_offset + header->main_size;
struct data_in *data_in;
struct lto_input_block ib_main;
unsigned int i;