summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2012-11-17 16:53:52 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2012-11-17 16:53:52 +0000
commitfa0628f7540c9f4859ee2a0aaf2d86b695e454b9 (patch)
treeda81b612ac69cfeaa57aae3c0ea1607832a32ef2
parentcbfcbe6148c0bebc53052fbc85f897d72c7d722d (diff)
Revert the va_start() and va_arg() optimization for functions which have no
variadic arguments passed in registers: these functions may pass a va_list to another function, which will then need to rely upon a properly filled __va_list struct and can't assume anything about the way arguments have been passed to its caller.
-rw-r--r--gnu/usr.bin/gcc/gcc/config/m88k/m88k.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/gnu/usr.bin/gcc/gcc/config/m88k/m88k.c b/gnu/usr.bin/gcc/gcc/config/m88k/m88k.c
index 3bbf8331e7d..1bbbd6e3501 100644
--- a/gnu/usr.bin/gcc/gcc/config/m88k/m88k.c
+++ b/gnu/usr.bin/gcc/gcc/config/m88k/m88k.c
@@ -2767,14 +2767,11 @@ m88k_va_start (valist, nextarg)
&& (TREE_VALUE (tree_last (TYPE_ARG_TYPES (fntype)))
!= void_type_node));
- /* Fill in the __va_arg member if it will ever be needed. */
- if (m88k_first_vararg < 8)
- {
- t = build (MODIFY_EXPR, TREE_TYPE (arg), arg,
- build_int_2 (m88k_first_vararg, 0));
- TREE_SIDE_EFFECTS (t) = 1;
- expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
- }
+ /* Fill in the __va_arg member. */
+ t = build (MODIFY_EXPR, TREE_TYPE (arg), arg,
+ build_int_2 (m88k_first_vararg, 0));
+ TREE_SIDE_EFFECTS (t) = 1;
+ expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
/* Store the arg pointer in the __va_stk member. */
offset = XINT (current_function_arg_offset_rtx, 0);
@@ -2817,9 +2814,9 @@ m88k_va_arg (valist, type)
addr_rtx = gen_reg_rtx (Pmode);
lab_done = gen_label_rtx ();
- /* Decide if we should read from stack or regs (if the argument could have
- been passed in registers, and some actually have). */
- if (reg_p && m88k_first_vararg < 8) {
+ /* Decide if we should read from stack or regs if the argument could have
+ been passed in registers. */
+ if (reg_p) {
tree arg, arg_align, reg;
rtx lab_stack;
tree t;