From 6fc3c2b2c42c5d5a177867aa5390f054d7d8a8a8 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Mon, 4 Aug 2008 14:56:12 +0000 Subject: [PATCH] re PR c++/37012 (numerous stackalign related testsuite failures on i686-apple-darwin9) 2008-08-04 H.J. Lu PR target/37012 * config/i386/i386.c (ix86_expand_prologue): Use UNITS_PER_WORD instead of STACK_BOUNDARY / BITS_PER_UNIT to align stack. (ix86_expand_epilogue): Likewise. From-SVN: r138631 --- gcc/ChangeLog | 7 +++++++ gcc/config/i386/i386.c | 14 ++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2c30ecf5690..9483e537986 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2008-08-04 H.J. Lu + + PR target/37012 + * config/i386/i386.c (ix86_expand_prologue): Use UNITS_PER_WORD + instead of STACK_BOUNDARY / BITS_PER_UNIT to align stack. + (ix86_expand_epilogue): Likewise. + 2008-08-04 H.J. Lu * config/i386/i386.c (ix86_compute_frame_layout): Fix a typo diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index aed74be112e..d31f176d9a3 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -7656,14 +7656,13 @@ ix86_expand_prologue (void) rtx x, y; int align_bytes = crtl->stack_alignment_needed / BITS_PER_UNIT; int param_ptr_offset = (call_used_regs[REGNO (crtl->drap_reg)] - ? 0 : STACK_BOUNDARY / BITS_PER_UNIT); + ? 0 : UNITS_PER_WORD); gcc_assert (stack_realign_drap); /* Grab the argument pointer. */ x = plus_constant (stack_pointer_rtx, - (STACK_BOUNDARY / BITS_PER_UNIT - + param_ptr_offset)); + (UNITS_PER_WORD + param_ptr_offset)); y = crtl->drap_reg; /* Only need to push parameter pointer reg if it is caller @@ -7690,8 +7689,7 @@ ix86_expand_prologue (void) expand_builtin_return_addr etc. */ x = crtl->drap_reg; x = gen_frame_mem (Pmode, - plus_constant (x, - -(STACK_BOUNDARY / BITS_PER_UNIT))); + plus_constant (x, -UNITS_PER_WORD)); insn = emit_insn (gen_push (x)); RTX_FRAME_RELATED_P (insn) = 1; } @@ -7855,7 +7853,7 @@ ix86_expand_prologue (void) /* vDRAP is setup but after reload it turns out stack realign isn't necessary, here we will emit prologue to setup DRAP without stack realign adjustment */ - int drap_bp_offset = STACK_BOUNDARY / BITS_PER_UNIT * 2; + int drap_bp_offset = UNITS_PER_WORD * 2; rtx x = plus_constant (hard_frame_pointer_rtx, drap_bp_offset); insn = emit_insn (gen_rtx_SET (VOIDmode, crtl->drap_reg, x)); } @@ -8054,11 +8052,11 @@ ix86_expand_epilogue (int style) if (crtl->drap_reg && crtl->stack_realign_needed) { int param_ptr_offset = (call_used_regs[REGNO (crtl->drap_reg)] - ? 0 : STACK_BOUNDARY / BITS_PER_UNIT); + ? 0 : UNITS_PER_WORD); gcc_assert (stack_realign_drap); emit_insn ((*ix86_gen_add3) (stack_pointer_rtx, crtl->drap_reg, - GEN_INT (-(STACK_BOUNDARY / BITS_PER_UNIT + GEN_INT (-(UNITS_PER_WORD + param_ptr_offset)))); if (!call_used_regs[REGNO (crtl->drap_reg)]) emit_insn ((*ix86_gen_pop1) (crtl->drap_reg));