summaryrefslogtreecommitdiff
path: root/gcc/explow.c
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2011-09-14 14:32:07 +0000
committerTom de Vries <vries@gcc.gnu.org>2011-09-14 14:32:07 +0000
commit50025f916d5c996973bcc0af1b020f1857c4e7ed (patch)
tree0dd6b799e735c86bdc57385a044aa7fb04685930 /gcc/explow.c
parent86b601168af25ef6881ebd5364235abc788731ca (diff)
downloadgcc-50025f916d5c996973bcc0af1b020f1857c4e7ed.tar.gz
re PR middle-end/50251 (Revision 178353 caused many test failures)
2011-09-14 Tom de Vries <tom@codesourcery.com> PR middle-end/50251 * explow.c (emit_stack_restore): Set crtl->need_drap if stack_restore is emitted. From-SVN: r178853
Diffstat (limited to 'gcc/explow.c')
-rw-r--r--gcc/explow.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/explow.c b/gcc/explow.c
index 984150efd05..11dffedd4b0 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -1062,6 +1062,20 @@ emit_stack_restore (enum save_level save_level, rtx sa)
/* The default is that we use a move insn. */
rtx (*fcn) (rtx, rtx) = gen_move_insn;
+ /* If stack_realign_drap, the x86 backend emits a prologue that aligns both
+ STACK_POINTER and HARD_FRAME_POINTER.
+ If stack_realign_fp, the x86 backend emits a prologue that aligns only
+ STACK_POINTER. This renders the HARD_FRAME_POINTER unusable for accessing
+ aligned variables, which is reflected in ix86_can_eliminate.
+ We normally still have the realigned STACK_POINTER that we can use.
+ But if there is a stack restore still present at reload, it can trigger
+ mark_not_eliminable for the STACK_POINTER, leaving no way to eliminate
+ FRAME_POINTER into a hard reg.
+ To prevent this situation, we force need_drap if we emit a stack
+ restore. */
+ if (SUPPORTS_STACK_ALIGNMENT)
+ crtl->need_drap = true;
+
/* See if this machine has anything special to do for this kind of save. */
switch (save_level)
{