summaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.c
diff options
context:
space:
mode:
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2009-01-15 15:44:41 +0000
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2009-01-15 15:44:41 +0000
commit9e1c1bf03da320ea334d451c8674772e43633b14 (patch)
tree26ee8baa1110a4cd957e834e172e0e3ca28e4648 /gcc/cfgexpand.c
parent66aca59dc569a233e1cca8bda6afd5d73d545e79 (diff)
downloadgcc-9e1c1bf03da320ea334d451c8674772e43633b14.tar.gz
gcc/
2009-01-15 H.J. Lu <hongjiu.lu@intel.com> Joey Ye <joey.ye@intel.com> PR middle-end/37843 * cfgexpand.c (expand_stack_alignment): Don't update stack boundary nor check incoming stack boundary here. (gimple_expand_cfg): Update stack boundary and check incoming stack boundary here. gcc/testsuite/ 2009-01-15 H.J. Lu <hongjiu.lu@intel.com> PR middle-end/37843 * gcc.target/i386/pr37843-3.c: Replace _Decimal128 with __m128. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@143400 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r--gcc/cfgexpand.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index e0c328f3959..6d7fe772fe7 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -2215,7 +2215,7 @@ static void
expand_stack_alignment (void)
{
rtx drap_rtx;
- unsigned int preferred_stack_boundary, incoming_stack_boundary;
+ unsigned int preferred_stack_boundary;
if (! SUPPORTS_STACK_ALIGNMENT)
return;
@@ -2228,10 +2228,6 @@ expand_stack_alignment (void)
gcc_assert (crtl->stack_alignment_needed
<= crtl->stack_alignment_estimated);
- /* Update stack boundary if needed. */
- if (targetm.calls.update_stack_boundary)
- targetm.calls.update_stack_boundary ();
-
/* Update crtl->stack_alignment_estimated and use it later to align
stack. We check PREFERRED_STACK_BOUNDARY if there may be non-call
exceptions since callgraph doesn't collect incoming stack alignment
@@ -2246,15 +2242,8 @@ 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;
@@ -2359,6 +2348,23 @@ gimple_expand_cfg (void)
if (crtl->stack_protect_guard)
stack_protect_prologue ();
+ /* Update stack boundary if needed. */
+ if (SUPPORTS_STACK_ALIGNMENT)
+ {
+ /* Call update_stack_boundary here to update incoming stack
+ boundary before TARGET_FUNCTION_OK_FOR_SIBCALL is called.
+ TARGET_FUNCTION_OK_FOR_SIBCALL needs to know the accurate
+ incoming stack alignment to check if it is OK to perform
+ sibcall optimization since sibcall optimization will only
+ align the outgoing stack to incoming stack boundary. */
+ if (targetm.calls.update_stack_boundary)
+ targetm.calls.update_stack_boundary ();
+
+ /* The incoming stack frame has to be aligned at least at
+ parm_stack_boundary. */
+ gcc_assert (crtl->parm_stack_boundary <= INCOMING_STACK_BOUNDARY);
+ }
+
/* Register rtl specific functions for cfg. */
rtl_register_cfg_hooks ();