From: Frank Ch. Eigler Date: Thu, 9 Sep 2004 16:33:25 +0000 (+0000) Subject: builtins.c (build_va_arg_indirect_ref): New function. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c2433d7d163406078b767dcc45c9426a089ce91a;p=gcc.git builtins.c (build_va_arg_indirect_ref): New function. 2004-09-09 Frank Ch. Eigler * 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. From-SVN: r87242 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b1ec6262758..76581c8f8be 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2004-09-09 Frank Ch. Eigler + + * 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 * cgraphunit.c (cgraph_mark_functions_to_output): Renable node diff --git a/gcc/builtins.c b/gcc/builtins.c index 537a5d4cd2b..34dceb9ef65 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -4358,13 +4358,18 @@ std_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, tree *post_p) 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); diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 3199b575691..25fa8d821ae 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -3291,7 +3291,7 @@ ix86_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p) 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); @@ -3440,12 +3440,12 @@ ix86_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p) 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); @@ -3507,8 +3507,8 @@ ix86_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_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); } /* Return nonzero if OPNUM's MEM should be matched diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index 8921a8a7e92..df4487ab513 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -3379,7 +3379,7 @@ ia64_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p) { 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 diff --git a/gcc/tree.h b/gcc/tree.h index c23ec7c769c..432a170b6de 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -3462,6 +3462,7 @@ extern tree strip_float_extensions (tree); 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);