diff options
author | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-06 15:29:37 +0000 |
---|---|---|
committer | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-06 15:29:37 +0000 |
commit | c6586120c02f926744ae783db4ce6401e0279d9a (patch) | |
tree | c3135360ae4b38adaeeb7da6a53d15035ce4a458 /gcc/cfgexpand.c | |
parent | 62e423241b25fe595c15c14cb3e5f6434a037f48 (diff) | |
download | gcc-c6586120c02f926744ae783db4ce6401e0279d9a.tar.gz |
gcc/
2008-08-06 H.J. Lu <hongjiu.lu@intel.com>
PR middle-end/37009
* cfgexpand.c (expand_stack_alignment): Check parm_stack_boundary
for incoming stack boundary.
* function.c (assign_parm_find_entry_rtl): Update
parm_stack_boundary.
* function.h (rtl_data): Add parm_stack_boundary.
* config/i386/i386.c (ix86_finalize_stack_realign_flags): Check
parm_stack_boundary for incoming stack boundary.
gcc/testsuite/
2008-08-06 H.J. Lu <hongjiu.lu@intel.com>
PR middle-end/37009
* gcc.dg/torture/stackalign/alloca-2.c: New.
* gcc.dg/torture/stackalign/alloca-3.c: Likewise.
* gcc.dg/torture/stackalign/alloca-4.c: Likewise.
* gcc.dg/torture/stackalign/vararg-3.c: Likewise.
* gcc.target/i386/incoming-1.c: Likewise.
* gcc.target/i386/incoming-2.c: Likewise.
* gcc.target/i386/incoming-3.c: Likewise.
* gcc.target/i386/incoming-4.c: Likewise.
* gcc.target/i386/incoming-5.c: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@138806 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r-- | gcc/cfgexpand.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index a943eff6ec1..8d1e5d2e3e8 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -2184,7 +2184,7 @@ static void expand_stack_alignment (void) { rtx drap_rtx; - unsigned int preferred_stack_boundary; + unsigned int preferred_stack_boundary, incoming_stack_boundary; if (! SUPPORTS_STACK_ALIGNMENT) return; @@ -2215,8 +2215,15 @@ expand_stack_alignment (void) if (preferred_stack_boundary > crtl->stack_alignment_needed) crtl->stack_alignment_needed = preferred_stack_boundary; + /* The incoming stack frame has to be aligned at least at + parm_stack_boundary. */ + if (crtl->parm_stack_boundary > INCOMING_STACK_BOUNDARY) + incoming_stack_boundary = crtl->parm_stack_boundary; + else + incoming_stack_boundary = INCOMING_STACK_BOUNDARY; + crtl->stack_realign_needed - = INCOMING_STACK_BOUNDARY < crtl->stack_alignment_estimated; + = incoming_stack_boundary < crtl->stack_alignment_estimated; crtl->stack_realign_tried = crtl->stack_realign_needed; crtl->stack_realign_processed = true; |