]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/50251 (Revision 178353 caused many test failures)
authorTom de Vries <tom@codesourcery.com>
Wed, 14 Sep 2011 14:32:07 +0000 (14:32 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Wed, 14 Sep 2011 14:32:07 +0000 (14:32 +0000)
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

gcc/ChangeLog
gcc/explow.c

index 1770b738dfc59be8f679bd049420c5f0e5d8db52..384245996248fde5317544b04e223edf940336d6 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2011-09-14  Julian Brown  <julian@codesourcery.com>
 
        * config/arm/arm.c (arm_override_options): Add unaligned_access
index 984150efd05ab5428fe97897f3a30f0178f004e0..11dffedd4b0f88fd92cb921967b3cab6b8d0124e 100644 (file)
@@ -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)
     {