]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
var-tracking.c (vt_stack_adjustments): Don't require stack_adjusts to match for the...
authorRichard Sandiford <rsandifo@linux.vnet.ibm.com>
Fri, 7 Feb 2014 14:49:12 +0000 (14:49 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Fri, 7 Feb 2014 14:49:12 +0000 (14:49 +0000)
gcc/
* var-tracking.c (vt_stack_adjustments): Don't require stack_adjusts
to match for the exit block.

From-SVN: r207602

gcc/ChangeLog
gcc/var-tracking.c

index 13fac243bb4033dabec3ef9fa62b3a35decc6e02..f6e3143b32f17dfc39c3a38b40d9559aa29b30fe 100644 (file)
@@ -1,3 +1,8 @@
+2014-02-07  Richard Sandiford  <rsandifo@linux.vnet.ibm.com>
+
+       * var-tracking.c (vt_stack_adjustments): Don't require stack_adjusts
+       to match for the exit block.
+
 2014-02-07  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
 
        * config/s390/s390.md ("atomic_load<mode>", "atomic_store<mode>")
index a13cac79f37b1690b70f0c403d157c057810a08e..c5ce1dd17b46912bba9461d325ea2425baf3b489 100644 (file)
@@ -886,8 +886,25 @@ vt_stack_adjustments (void)
        }
       else
        {
-         /* Check whether the adjustments on the edges are the same.  */
-         if (VTI (dest)->in.stack_adjust != VTI (src)->out.stack_adjust)
+         /* We can end up with different stack adjustments for the exit block
+            of a shrink-wrapped function if stack_adjust_offset_pre_post
+            doesn't understand the rtx pattern used to restore the stack
+            pointer in the epilogue.  For example, on s390(x), the stack
+            pointer is often restored via a load-multiple instruction
+            and so no stack_adjust offset is recorded for it.  This means
+            that the stack offset at the end of the epilogue block is the
+            the same as the offset before the epilogue, whereas other paths
+            to the exit block will have the correct stack_adjust.
+
+            It is safe to ignore these differences because (a) we never
+            use the stack_adjust for the exit block in this pass and
+            (b) dwarf2cfi checks whether the CFA notes in a shrink-wrapped
+            function are correct.
+
+            We must check whether the adjustments on other edges are
+            the same though.  */
+         if (dest != EXIT_BLOCK_PTR_FOR_FN (cfun)
+             && VTI (dest)->in.stack_adjust != VTI (src)->out.stack_adjust)
            {
              free (stack);
              return false;