i386.c (ix86_expand_epilogue): Properly compute size of registers to restore along...
authorRichard Henderson <rth@redhat.com>
Wed, 25 Apr 2001 21:56:54 +0000 (14:56 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Wed, 25 Apr 2001 21:56:54 +0000 (14:56 -0700)
        * config/i386/i386.c (ix86_expand_epilogue): Properly compute size
        of registers to restore along non eh_return path.

From-SVN: r41555

gcc/ChangeLog
gcc/config/i386/i386.c

index 323dc83..7e58efa 100644 (file)
@@ -1,3 +1,8 @@
+2001-04-25  Richard Henderson  <rth@redhat.com>
+
+       * config/i386/i386.c (ix86_expand_epilogue): Properly compute size
+       of registers to restore along non eh_return path.
+
 2001-04-25  Jakub Jelinek  <jakub@redhat.com>
 
        * c-format.c (check_format_info_recurse): Handle
index 5e5b5a5..a0e40ba 100644 (file)
@@ -2591,8 +2591,14 @@ ix86_expand_epilogue (style)
 
   ix86_compute_frame_layout (&frame);
 
-  /* Calculate start of saved registers relative to ebp.  */
-  offset = -frame.nregs * UNITS_PER_WORD;
+  /* Calculate start of saved registers relative to ebp.  Special care 
+     must be taken for the normal return case of a function using
+     eh_return: the eax and edx registers are marked as saved, but not
+     restored along this path.  */
+  offset = frame.nregs;
+  if (current_function_calls_eh_return && style != 2)
+    offset -= 2;
+  offset *= -UNITS_PER_WORD;
 
 #ifdef FUNCTION_BLOCK_PROFILER_EXIT
   if (profile_block_flag == 2)