+2004-09-09 Frank Ch. Eigler <fche@redhat.com>
+
+ * builtins.c (build_va_arg_indirect_ref): New function.
+ (std_gimplify_va_arg_expr): Call it instead of mudflap check and
+ build_fold_indirect_ref.
+ * config/i386/i386.c (ix86_gimplify_va_arg): Ditto.
+ * config/ia64/ia64.c (ia64_gimplify_va_arg): Ditto.
+ * tree.h: Declare new function.
+
2004-09-08 Nathan Sidwell <nathan@codesourcery.com>
* cgraphunit.c (cgraph_mark_functions_to_output): Renable node
addr = fold_convert (build_pointer_type (type), addr);
if (indirect)
- {
- addr = build_fold_indirect_ref (addr);
- if (flag_mudflap) /* Don't instrument va_arg INDIRECT_REF. */
- mf_mark (addr);
- }
+ addr = build_va_arg_indirect_ref (addr);
+
+ return build_va_arg_indirect_ref (addr);
+}
+/* Build an indirect-ref expression over the given TREE, which represents a
+ piece of a va_arg() expansion. */
+tree
+build_va_arg_indirect_ref (tree addr)
+{
addr = build_fold_indirect_ref (addr);
+
if (flag_mudflap) /* Don't instrument va_arg INDIRECT_REF. */
mf_mark (addr);
f_ovf = TREE_CHAIN (f_fpr);
f_sav = TREE_CHAIN (f_ovf);
- valist = build_fold_indirect_ref (valist);
+ valist = build_va_arg_indirect_ref (valist);
gpr = build (COMPONENT_REF, TREE_TYPE (f_gpr), valist, f_gpr, NULL_TREE);
fpr = build (COMPONENT_REF, TREE_TYPE (f_fpr), valist, f_fpr, NULL_TREE);
ovf = build (COMPONENT_REF, TREE_TYPE (f_ovf), valist, f_ovf, NULL_TREE);
src_addr = fold_convert (addr_type, src_addr);
src_addr = fold (build2 (PLUS_EXPR, addr_type, src_addr,
size_int (src_offset)));
- src = build_fold_indirect_ref (src_addr);
+ src = build_va_arg_indirect_ref (src_addr);
dest_addr = fold_convert (addr_type, addr);
dest_addr = fold (build2 (PLUS_EXPR, addr_type, dest_addr,
size_int (INTVAL (XEXP (slot, 1)))));
- dest = build_fold_indirect_ref (dest_addr);
+ dest = build_va_arg_indirect_ref (dest_addr);
t = build2 (MODIFY_EXPR, void_type_node, dest, src);
gimplify_and_add (t, pre_p);
addr = fold_convert (ptrtype, addr);
if (indirect_p)
- addr = build_fold_indirect_ref (addr);
- return build_fold_indirect_ref (addr);
+ addr = build_va_arg_indirect_ref (addr);
+ return build_va_arg_indirect_ref (addr);
}
\f
/* Return nonzero if OPNUM's MEM should be matched
{
tree ptrtype = build_pointer_type (type);
tree addr = std_gimplify_va_arg_expr (valist, ptrtype, pre_p, post_p);
- return build_fold_indirect_ref (addr);
+ return build_va_arg_indirect_ref (addr);
}
/* Aggregate arguments with alignment larger than 8 bytes start at
extern tree simplify_builtin (tree, int);
extern tree c_strlen (tree, int);
extern tree std_gimplify_va_arg_expr (tree, tree, tree *, tree *);
+extern tree build_va_arg_indirect_ref (tree);
/* In convert.c */
extern tree strip_float_extensions (tree);