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);
}
|| 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