OSDN Git Service

2009-01-31 Dave Korn <dave.korn.cygwin@gmail.com>
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 31 Jan 2009 17:34:03 +0000 (17:34 +0000)
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 31 Jan 2009 17:34:03 +0000 (17:34 +0000)
PR target/38952
* config/i386/i386.c (ix86_builtin_setjmp_frame_value): New.
(TARGET_BUILTIN_SETJMP_FRAME_VALUE): Override default to point
at it.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@143823 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 96051f6..194b0f0 100644 (file)
@@ -1,3 +1,10 @@
+2009-01-31  Dave Korn  <dave.korn.cygwin@gmail.com>
+
+       PR target/38952
+       * config/i386/i386.c (ix86_builtin_setjmp_frame_value): New.
+       (TARGET_BUILTIN_SETJMP_FRAME_VALUE): Override default to point
+       at it.
+
 2009-01-31  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/38937
index c60ec5a..c7ddce1 100644 (file)
@@ -7497,6 +7497,17 @@ ix86_initial_elimination_offset (int from, int to)
     }
 }
 
+/* In a dynamically-aligned function, we can't know the offset from
+   stack pointer to frame pointer, so we must ensure that setjmp
+   eliminates fp against the hard fp (%ebp) rather than trying to
+   index from %esp up to the top of the frame across a gap that is
+   of unknown (at compile-time) size.  */
+static rtx
+ix86_builtin_setjmp_frame_value (void)
+{
+  return stack_realign_fp ? hard_frame_pointer_rtx : virtual_stack_vars_rtx;
+}
+
 /* Fill structure ix86_frame about frame of currently computed function.  */
 
 static void
@@ -29542,6 +29553,9 @@ ix86_enum_va_list (int idx, const char **pname, tree *ptree)
 #undef TARGET_MACHINE_DEPENDENT_REORG
 #define TARGET_MACHINE_DEPENDENT_REORG ix86_reorg
 
+#undef TARGET_BUILTIN_SETJMP_FRAME_VALUE
+#define TARGET_BUILTIN_SETJMP_FRAME_VALUE ix86_builtin_setjmp_frame_value
+
 #undef TARGET_BUILD_BUILTIN_VA_LIST
 #define TARGET_BUILD_BUILTIN_VA_LIST ix86_build_builtin_va_list