diff options
author | Richard Sandiford <rsandifo@linux.vnet.ibm.com> | 2014-02-07 14:49:12 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2014-02-07 14:49:12 +0000 |
commit | 3489cc3363c657e70b5c4dd25abf6f0de6d83c72 (patch) | |
tree | ed6c1bca6a64f2b131689c9f07556df93641def9 | |
parent | 75cc21e2b7153b7561a7636fd668ba66f10b72eb (diff) | |
download | gcc-3489cc3363c657e70b5c4dd25abf6f0de6d83c72.zip gcc-3489cc3363c657e70b5c4dd25abf6f0de6d83c72.tar.gz gcc-3489cc3363c657e70b5c4dd25abf6f0de6d83c72.tar.bz2 |
var-tracking.c (vt_stack_adjustments): Don't require stack_adjusts to match for the exit block.
gcc/
* var-tracking.c (vt_stack_adjustments): Don't require stack_adjusts
to match for the exit block.
From-SVN: r207602
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/var-tracking.c | 21 |
2 files changed, 24 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 13fac24..f6e3143 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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>") diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c index a13cac7..c5ce1dd 100644 --- a/gcc/var-tracking.c +++ b/gcc/var-tracking.c @@ -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; |