[pypy-commit] stmgc default: Backing out fba24ba1a75f: gcc does some optimizations before entering

arigo noreply at buildbot.pypy.org
Sat May 30 09:00:15 CEST 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r1782:a49dca73c968
Date: 2015-05-30 09:00 +0200
http://bitbucket.org/pypy/stmgc/changeset/a49dca73c968/

Log:	Backing out fba24ba1a75f: gcc does some optimizations before
	entering the RTL mode, and these optimizations seem prone to
	dropping the address space. In other words, it doesn't work at all.

diff --git a/c7/demo/Makefile b/c7/demo/Makefile
--- a/c7/demo/Makefile
+++ b/c7/demo/Makefile
@@ -19,20 +19,18 @@
 
 COMMON = -I.. -pthread -lrt -g -Wall -Werror -DSTM_LARGEMALLOC_TEST
 
-CC = gcc-seg-gs
-
 
 # note that 'build' is partially optimized but still contains all asserts
 debug-%: %.c ${H_FILES} ${C_FILES}
-	$(CC) $(COMMON) -DSTM_DEBUGPRINT -DSTM_GC_NURSERY=128 -O0 \
+	clang $(COMMON) -DSTM_DEBUGPRINT -DSTM_GC_NURSERY=128 -O0 \
         $< -o debug-$* ../stmgc.c
 
 build-%: %.c ${H_FILES} ${C_FILES}
-	$(CC) $(COMMON) -DSTM_GC_NURSERY=128 -O1 $< -o build-$* ../stmgc.c
+	clang $(COMMON) -DSTM_GC_NURSERY=128 -O1 $< -o build-$* ../stmgc.c
 
 release-%: %.c ${H_FILES} ${C_FILES}
-	$(CC) $(COMMON) -DNDEBUG -O2 $< -o release-$* ../stmgc.c
+	clang $(COMMON) -DNDEBUG -O2 $< -o release-$* ../stmgc.c
 
 
 release-htm-%: %.c ../../htm-c7/stmgc.? ../../htm-c7/htm.h
-	$(CC) $(COMMON) -O2 $< -o release-htm-$* ../../htm-c7/stmgc.c -DUSE_HTM
+	clang $(COMMON) -O2 $< -o release-htm-$* ../../htm-c7/stmgc.c -DUSE_HTM
diff --git a/c7/demo/demo2.c b/c7/demo/demo2.c
--- a/c7/demo/demo2.c
+++ b/c7/demo/demo2.c
@@ -216,7 +216,7 @@
 
 void teardown_list(void)
 {
-    STM_POP_ROOT_DROP(stm_thread_local);
+    STM_POP_ROOT_RET(stm_thread_local);
 }
 
 
@@ -256,7 +256,6 @@
     stm_rewind_jmp_leaveframe(&stm_thread_local, &rjbuf);
     unregister_thread_local();
     status = sem_post(&done); assert(status == 0);
-    (void)status;
     return NULL;
 }
 
@@ -294,7 +293,6 @@
     rewind_jmp_buf rjbuf;
 
     status = sem_init(&done, 0, 0); assert(status == 0);
-    (void)status;
 
     stm_setup();
     stm_register_thread_local(&stm_thread_local);
diff --git a/c7/demo/demo_random.c b/c7/demo/demo_random.c
--- a/c7/demo/demo_random.c
+++ b/c7/demo/demo_random.c
@@ -412,7 +412,6 @@
     stm_unregister_thread_local(&stm_thread_local);
 
     status = sem_post(&done); assert(status == 0);
-    (void)status;
     return NULL;
 }
 
diff --git a/c7/demo/demo_random2.c b/c7/demo/demo_random2.c
--- a/c7/demo/demo_random2.c
+++ b/c7/demo/demo_random2.c
@@ -435,7 +435,6 @@
     stm_unregister_thread_local(&stm_thread_local);
 
     status = sem_post(&done); assert(status == 0);
-    (void)status;
     return NULL;
 }
 
diff --git a/c7/demo/test_shadowstack.c b/c7/demo/test_shadowstack.c
--- a/c7/demo/test_shadowstack.c
+++ b/c7/demo/test_shadowstack.c
@@ -54,7 +54,7 @@
        then do a major collection.  It should still be found by the
        tracing logic. */
     stm_start_transaction(&stm_thread_local);
-    STM_POP_ROOT_DROP(stm_thread_local);
+    STM_POP_ROOT_RET(stm_thread_local);
     STM_POP_ROOT(stm_thread_local, node);
     assert(node->value == 129821);
     STM_PUSH_ROOT(stm_thread_local, NULL);
diff --git a/c7/stm/core.c b/c7/stm/core.c
--- a/c7/stm/core.c
+++ b/c7/stm/core.c
@@ -45,6 +45,7 @@
 #endif
 }
 
+__attribute__((always_inline))
 static void write_slowpath_overflow_obj(object_t *obj, bool mark_card)
 {
     /* An overflow object is an object from the same transaction, but
@@ -78,6 +79,7 @@
     }
 }
 
+__attribute__((always_inline))
 static void write_slowpath_common(object_t *obj, bool mark_card)
 {
     assert(_seems_to_be_running_transaction());
@@ -221,7 +223,6 @@
     check_flag_write_barrier(obj);
 }
 
-__attribute__((flatten))
 void _stm_write_slowpath(object_t *obj)
 {
     write_slowpath_common(obj, /*mark_card=*/false);
@@ -240,7 +241,6 @@
     return (size >= _STM_MIN_CARD_OBJ_SIZE);
 }
 
-__attribute__((flatten))
 char _stm_write_slowpath_card_extra(object_t *obj)
 {
     /* the PyPy JIT calls this function directly if it finds that an
diff --git a/c7/stm/forksupport.c b/c7/stm/forksupport.c
--- a/c7/stm/forksupport.c
+++ b/c7/stm/forksupport.c
@@ -58,7 +58,7 @@
     /* Make a new mmap at some other address, but of the same size as
        the standard mmap at stm_object_pages
     */
-    int big_copy_fd = -1;
+    int big_copy_fd;
     char *big_copy = setup_mmap("stmgc's fork support", &big_copy_fd);
 
     /* Copy all the data from the two ranges of objects (large, small)
diff --git a/c7/stm/fprintcolor.c b/c7/stm/fprintcolor.c
--- a/c7/stm/fprintcolor.c
+++ b/c7/stm/fprintcolor.c
@@ -1,5 +1,3 @@
-#include <stdarg.h>
-
 /* ------------------------------------------------------------ */
 #ifdef STM_DEBUGPRINT
 /* ------------------------------------------------------------ */
diff --git a/c7/stmgc.h b/c7/stmgc.h
--- a/c7/stmgc.h
+++ b/c7/stmgc.h
@@ -20,15 +20,7 @@
 #endif
 
 
-#ifdef __SEG_GS     /* on a custom patched gcc */
-#  define TLPREFIX __seg_gs
-#  define _STM_RM_SUFFIX  :8
-#elif defined(__clang__)   /* on a clang, hopefully made bug-free */
-#  define TLPREFIX __attribute__((address_space(256)))
-#  define _STM_RM_SUFFIX  /* nothing */
-#else
-#  error "needs either a GCC with __seg_gs support, or a bug-freed clang"
-#endif
+#define TLPREFIX __attribute__((address_space(256)))
 
 typedef TLPREFIX struct object_s object_t;
 typedef TLPREFIX struct stm_segment_info_s stm_segment_info_t;
@@ -42,11 +34,11 @@
        'STM_SEGMENT->transaction_read_version' if and only if the
        object was read in the current transaction.  The nurseries
        also have corresponding read markers, but they are never used. */
-    unsigned char rm _STM_RM_SUFFIX;
+    uint8_t rm;
 };
 
 struct stm_segment_info_s {
-    unsigned int transaction_read_version;
+    uint8_t transaction_read_version;
     int segment_num;
     char *segment_base;
     stm_char *nursery_current;
@@ -296,7 +288,6 @@
 #define STM_PUSH_ROOT(tl, p)   ((tl).shadowstack++->ss = (object_t *)(p))
 #define STM_POP_ROOT(tl, p)    ((p) = (typeof(p))((--(tl).shadowstack)->ss))
 #define STM_POP_ROOT_RET(tl)   ((--(tl).shadowstack)->ss)
-#define STM_POP_ROOT_DROP(tl)  ((void)(--(tl).shadowstack))
 
 
 /* Every thread needs to have a corresponding stm_thread_local_t
@@ -311,12 +302,7 @@
 
 /* At some key places, like the entry point of the thread and in the
    function with the interpreter's dispatch loop, you need to declare
-   a local variable of type 'rewind_jmp_buf' and call these macros.
-   IMPORTANT: a function in which you call stm_rewind_jmp_enterframe()
-   must never change the value of its own arguments!  If they are
-   passed on the stack, gcc can change the value directly there, but
-   we're missing the logic to save/restore this part!
-*/
+   a local variable of type 'rewind_jmp_buf' and call these macros. */
 #define stm_rewind_jmp_enterprepframe(tl, rjbuf)   \
     rewind_jmp_enterprepframe(&(tl)->rjthread, rjbuf, (tl)->shadowstack)
 #define stm_rewind_jmp_enterframe(tl, rjbuf)       \
@@ -520,7 +506,7 @@
 
 #define STM_POP_MARKER(tl)   ({                 \
     object_t *_popped = STM_POP_ROOT_RET(tl);   \
-    STM_POP_ROOT_DROP(tl);                      \
+    STM_POP_ROOT_RET(tl);                       \
     _popped;                                    \
 })
 
diff --git a/c7/test/common.py b/c7/test/common.py
--- a/c7/test/common.py
+++ b/c7/test/common.py
@@ -3,7 +3,7 @@
 assert sys.maxint == 9223372036854775807, "requires a 64-bit environment"
 
 # ----------
-os.environ['CC'] = 'gcc-seg-gs'
+os.environ['CC'] = 'clang'
 
 parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
 
diff --git a/c7/test/support.py b/c7/test/support.py
--- a/c7/test/support.py
+++ b/c7/test/support.py
@@ -478,8 +478,7 @@
                     ],
      undef_macros=['NDEBUG'],
      include_dirs=[parent_dir],
-     extra_compile_args=['-g', '-O0', '-Werror',  #, '-ferror-limit=1',  for clang
-                         '-Wfatal-errors'],   # for gcc
+     extra_compile_args=['-g', '-O0', '-Werror', '-ferror-limit=1'],
      extra_link_args=['-g', '-lrt'],
      force_generic_engine=True)
 
diff --git a/c7/test/test_list.py b/c7/test/test_list.py
--- a/c7/test/test_list.py
+++ b/c7/test/test_list.py
@@ -56,7 +56,7 @@
 ''', define_macros=[('STM_TESTS', '1')],
      undef_macros=['NDEBUG'],
      include_dirs=[parent_dir],
-     extra_compile_args=['-g', '-O0', '-Werror'], #, '-ferror-limit=1'],
+     extra_compile_args=['-g', '-O0', '-Werror', '-ferror-limit=1'],
      force_generic_engine=True)
 
 # ____________________________________________________________
diff --git a/c7/test/test_rewind.c b/c7/test/test_rewind.c
--- a/c7/test/test_rewind.c
+++ b/c7/test/test_rewind.c
@@ -174,26 +174,12 @@
 void foo(int *x) { ++*x; }
 
 __attribute__((noinline))
-void f6(int c1, int c2, int c3, int c4, int c5, int c6, int c7,
-        int c8, int c9, int c10, int c11, int c12, int c13)
+void f6(int a1, int a2, int a3, int a4, int a5, int a6, int a7,
+        int a8, int a9, int a10, int a11, int a12, int a13)
 {
     rewind_jmp_buf buf;
     rewind_jmp_enterframe(&gthread, &buf, NULL);
 
-    int a1 = c1;
-    int a2 = c2;
-    int a3 = c3;
-    int a4 = c4;
-    int a5 = c5;
-    int a6 = c6;
-    int a7 = c7;
-    int a8 = c8;
-    int a9 = c9;
-    int a10 = c10;
-    int a11 = c11;
-    int a12 = c12;
-    int a13 = c13;
-
     rewind_jmp_setjmp(&gthread, NULL);
     gevent(a1); gevent(a2); gevent(a3); gevent(a4);
     gevent(a5); gevent(a6); gevent(a7); gevent(a8);
diff --git a/c7/test/test_rewind.py b/c7/test/test_rewind.py
--- a/c7/test/test_rewind.py
+++ b/c7/test/test_rewind.py
@@ -1,11 +1,11 @@
 import os
 
 def run_test(opt):
-    err = os.system("gcc-seg-gs -g -O%s -Werror -DRJBUF_CUSTOM_MALLOC -I../stm"
+    err = os.system("clang -g -O%s -Werror -DRJBUF_CUSTOM_MALLOC -I../stm"
                     " -o test_rewind_O%s test_rewind.c ../stm/rewind_setjmp.c"
                     % (opt, opt))
     if err != 0:
-        raise OSError("gcc-seg-gs failed on test_rewind.c")
+        raise OSError("clang failed on test_rewind.c")
     for testnum in [1, 2, 3, 4, 5, 6, 7, "TL1", "TL2"]:
         print '=== O%s: RUNNING TEST %s ===' % (opt, testnum)
         err = os.system("./test_rewind_O%s %s" % (opt, testnum))
diff --git a/gcc-seg-gs/README.txt b/gcc-seg-gs/README.txt
deleted file mode 100644
--- a/gcc-seg-gs/README.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-Get gcc release 5.1.0 from the download page:
-    
-    https://gcc.gnu.org/mirrors.html
-
-Unpack it.
-
-Apply the patch provided here in the file gcc-5.1.0-patch.diff.
-
-You can either install the 'libmpc-dev' package on your system,
-or else, manually:
-    
-    * unpack 'https://ftp.gnu.org/gnu/gmp/gmp-6.0.0a.tar.xz'
-      and move 'gmp-6.0.0' as 'gcc-5.1.0/gmp'.
-
-    * unpack 'http://www.mpfr.org/mpfr-current/mpfr-3.1.2.tar.xz'
-      and move 'mpfr-3.1.2' as 'gcc-5.1.0/mpfr'
-
-    * unpack 'ftp://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz'
-      and move 'mpc-1.0.3' as 'gcc-5.1.0/mpc'
-
-Compile gcc as usual:
-    
-    mkdir build
-    cd build
-    ../gcc-5.1.0/configure --enable-languages=c --disable-multilib
-    make    # or maybe only "make all-stage1-gcc"
-
-This patched gcc could be globally installed, but in these instructions
-we assume you don't want that.  Instead, create the following script,
-call it 'gcc-seg-gs', and put it in the $PATH:
-
-    #!/bin/bash
-    BUILD=/..../build      # <- insert full path
-    exec $BUILD/gcc/xgcc -B $BUILD/gcc "$@"
diff --git a/gcc-seg-gs/gcc-5.1.0-patch.diff b/gcc-seg-gs/gcc-5.1.0-patch.diff
deleted file mode 100644
--- a/gcc-seg-gs/gcc-5.1.0-patch.diff
+++ /dev/null
@@ -1,269 +0,0 @@
-Index: gcc/doc/tm.texi.in
-===================================================================
---- gcc/doc/tm.texi.in	(revision 223859)
-+++ gcc/doc/tm.texi.in	(working copy)
-@@ -7424,6 +7424,8 @@
- 
- @hook TARGET_ADDR_SPACE_CONVERT
- 
-+ at hook TARGET_ADDR_SPACE_DEFAULT_POINTER_ADDRESS_MODES_P
-+
- @node Misc
- @section Miscellaneous Parameters
- @cindex parameters, miscellaneous
-Index: gcc/doc/tm.texi
-===================================================================
---- gcc/doc/tm.texi	(revision 223859)
-+++ gcc/doc/tm.texi	(working copy)
-@@ -10290,6 +10290,17 @@
- as determined by the @code{TARGET_ADDR_SPACE_SUBSET_P} target hook.
- @end deftypefn
- 
-+ at deftypefn {Target Hook} bool TARGET_ADDR_SPACE_DEFAULT_POINTER_ADDRESS_MODES_P (void)
-+Some places still assume that all pointer or address modes are the
-+standard Pmode and ptr_mode.  These optimizations become invalid if
-+the target actually supports multiple different modes.  This hook returns
-+true if all pointers and addresses are Pmode and ptr_mode, and false
-+otherwise.  Called via target_default_pointer_address_modes_p().  The
-+default NULL for the hook makes this function return true if the two hooks
-+ at code{TARGET_ADDR_SPACE_POINTER_MODE}, @code{TARGET_ADDR_SPACE_ADDRESS_MODE}
-+are undefined, and false otherwise.
-+ at end deftypefn
-+
- @node Misc
- @section Miscellaneous Parameters
- @cindex parameters, miscellaneous
-Index: gcc/target.def
-===================================================================
---- gcc/target.def	(revision 223859)
-+++ gcc/target.def	(working copy)
-@@ -3164,6 +3164,19 @@
-  rtx, (rtx op, tree from_type, tree to_type),
-  default_addr_space_convert)
- 
-+/* True if all pointer or address modes are the standard Pmode and ptr_mode. */
-+DEFHOOK
-+(default_pointer_address_modes_p,
-+ "Some places still assume that all pointer or address modes are the\n\
-+standard Pmode and ptr_mode.  These optimizations become invalid if\n\
-+the target actually supports multiple different modes.  This hook returns\n\
-+true if all pointers and addresses are Pmode and ptr_mode, and false\n\
-+otherwise.  Called via target_default_pointer_address_modes_p().  The\n\
-+default NULL for the hook makes this function return true if the two hooks\n\
-+ at code{TARGET_ADDR_SPACE_POINTER_MODE}, @code{TARGET_ADDR_SPACE_ADDRESS_MODE}\n\
-+are undefined, and false otherwise.",
-+ bool, (void), NULL)
-+
- HOOK_VECTOR_END (addr_space)
- 
- #undef HOOK_PREFIX
-Index: gcc/targhooks.c
-===================================================================
---- gcc/targhooks.c	(revision 223859)
-+++ gcc/targhooks.c	(working copy)
-@@ -1228,6 +1228,9 @@
- bool
- target_default_pointer_address_modes_p (void)
- {
-+  if (targetm.addr_space.default_pointer_address_modes_p != NULL)
-+    return targetm.addr_space.default_pointer_address_modes_p();
-+
-   if (targetm.addr_space.address_mode != default_addr_space_address_mode)
-     return false;
-   if (targetm.addr_space.pointer_mode != default_addr_space_pointer_mode)
-Index: gcc/config/i386/i386-c.c
-===================================================================
---- gcc/config/i386/i386-c.c	(revision 223859)
-+++ gcc/config/i386/i386-c.c	(working copy)
-@@ -572,6 +572,9 @@
- 			       ix86_tune,
- 			       ix86_fpmath,
- 			       cpp_define);
-+
-+  cpp_define (parse_in, "__SEG_FS");
-+  cpp_define (parse_in, "__SEG_GS");
- }
- 
- 

-@@ -586,6 +589,9 @@
-   /* Update pragma hook to allow parsing #pragma GCC target.  */
-   targetm.target_option.pragma_parse = ix86_pragma_target_parse;
- 
-+  c_register_addr_space ("__seg_fs", ADDR_SPACE_SEG_FS);
-+  c_register_addr_space ("__seg_gs", ADDR_SPACE_SEG_GS);
-+
- #ifdef REGISTER_SUBTARGET_PRAGMAS
-   REGISTER_SUBTARGET_PRAGMAS ();
- #endif
-Index: gcc/config/i386/i386.c
-===================================================================
---- gcc/config/i386/i386.c	(revision 223859)
-+++ gcc/config/i386/i386.c	(working copy)
-@@ -15963,6 +15963,20 @@
- 	  fputs (" PTR ", file);
- 	}
- 
-+      /**** <AR> ****/
-+      switch (MEM_ADDR_SPACE(x))
-+	{
-+	case ADDR_SPACE_SEG_FS:
-+	  fputs (ASSEMBLER_DIALECT == ASM_ATT ? "%fs:" : "fs:", file);
-+	  break;
-+	case ADDR_SPACE_SEG_GS:
-+	  fputs (ASSEMBLER_DIALECT == ASM_ATT ? "%gs:" : "gs:", file);
-+	  break;
-+	default:
-+	  break;
-+	}
-+      /**** </AR> ****/
-+
-       x = XEXP (x, 0);
-       /* Avoid (%rip) for call operands.  */
-       if (CONSTANT_ADDRESS_P (x) && code == 'P'
-@@ -51816,6 +51830,130 @@
- }
- #endif
- 
-+
-+/***** <AR> *****/
-+
-+/*** GS segment register addressing mode ***/
-+
-+static machine_mode
-+ix86_addr_space_pointer_mode (addr_space_t as)
-+{
-+  gcc_assert (as == ADDR_SPACE_GENERIC ||
-+	      as == ADDR_SPACE_SEG_FS ||
-+	      as == ADDR_SPACE_SEG_GS);
-+  return ptr_mode;
-+}
-+
-+/* Return the appropriate mode for a named address address.  */
-+static machine_mode
-+ix86_addr_space_address_mode (addr_space_t as)
-+{
-+  gcc_assert (as == ADDR_SPACE_GENERIC ||
-+	      as == ADDR_SPACE_SEG_FS ||
-+	      as == ADDR_SPACE_SEG_GS);
-+  return Pmode;
-+}
-+
-+/* Named address space version of valid_pointer_mode.  */
-+static bool
-+ix86_addr_space_valid_pointer_mode (machine_mode mode, addr_space_t as)
-+{
-+  gcc_assert (as == ADDR_SPACE_GENERIC ||
-+	      as == ADDR_SPACE_SEG_FS ||
-+	      as == ADDR_SPACE_SEG_GS);
-+  return targetm.valid_pointer_mode (mode);
-+}
-+
-+/* Like ix86_legitimate_address_p, except with named addresses.  */
-+static bool
-+ix86_addr_space_legitimate_address_p (machine_mode mode, rtx x,
-+				      bool reg_ok_strict, addr_space_t as)
-+{
-+  gcc_assert (as == ADDR_SPACE_GENERIC ||
-+	      as == ADDR_SPACE_SEG_FS ||
-+	      as == ADDR_SPACE_SEG_GS);
-+  return ix86_legitimate_address_p (mode, x, reg_ok_strict);
-+}
-+
-+/* Named address space version of LEGITIMIZE_ADDRESS.  */
-+static rtx
-+ix86_addr_space_legitimize_address (rtx x, rtx oldx,
-+				    machine_mode mode, addr_space_t as)
-+{
-+  gcc_assert (as == ADDR_SPACE_GENERIC ||
-+	      as == ADDR_SPACE_SEG_FS ||
-+	      as == ADDR_SPACE_SEG_GS);
-+  return ix86_legitimize_address (x, oldx, mode);
-+}
-+
-+/* The default, SEG_FS and SEG_GS address spaces are all "subsets" of
-+   each other. */
-+bool static 
-+ix86_addr_space_subset_p (addr_space_t subset, addr_space_t superset)
-+{
-+  gcc_assert (subset == ADDR_SPACE_GENERIC ||
-+	      subset == ADDR_SPACE_SEG_FS ||
-+	      subset == ADDR_SPACE_SEG_GS);
-+  gcc_assert (superset == ADDR_SPACE_GENERIC ||
-+	      superset == ADDR_SPACE_SEG_FS ||
-+	      superset == ADDR_SPACE_SEG_GS);
-+  return true;
-+}
-+
-+/* Convert from one address space to another: it is a no-op.
-+   It is the C code's responsibility to write sensible casts. */
-+static rtx
-+ix86_addr_space_convert (rtx op, tree from_type, tree to_type)
-+{
-+  addr_space_t from_as = TYPE_ADDR_SPACE (TREE_TYPE (from_type));
-+  addr_space_t to_as = TYPE_ADDR_SPACE (TREE_TYPE (to_type));
-+
-+  gcc_assert (from_as == ADDR_SPACE_GENERIC ||
-+	      from_as == ADDR_SPACE_SEG_FS ||
-+	      from_as == ADDR_SPACE_SEG_GS);
-+  gcc_assert (to_as == ADDR_SPACE_GENERIC ||
-+	      to_as == ADDR_SPACE_SEG_FS ||
-+	      to_as == ADDR_SPACE_SEG_GS);
-+
-+  return op;
-+}
-+
-+static bool
-+ix86_addr_space_default_pointer_address_modes_p (void)
-+{
-+  return true;    /* all pointer and address modes are still Pmode/ptr_mode */
-+}
-+
-+#undef TARGET_ADDR_SPACE_POINTER_MODE
-+#define TARGET_ADDR_SPACE_POINTER_MODE ix86_addr_space_pointer_mode
-+
-+#undef TARGET_ADDR_SPACE_ADDRESS_MODE
-+#define TARGET_ADDR_SPACE_ADDRESS_MODE ix86_addr_space_address_mode
-+
-+#undef TARGET_ADDR_SPACE_VALID_POINTER_MODE
-+#define TARGET_ADDR_SPACE_VALID_POINTER_MODE ix86_addr_space_valid_pointer_mode
-+
-+#undef TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P
-+#define TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P \
-+  ix86_addr_space_legitimate_address_p
-+
-+#undef TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS
-+#define TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS \
-+  ix86_addr_space_legitimize_address
-+
-+#undef TARGET_ADDR_SPACE_SUBSET_P
-+#define TARGET_ADDR_SPACE_SUBSET_P ix86_addr_space_subset_p
-+
-+#undef TARGET_ADDR_SPACE_CONVERT
-+#define TARGET_ADDR_SPACE_CONVERT ix86_addr_space_convert
-+
-+#undef TARGET_ADDR_SPACE_DEFAULT_POINTER_ADDRESS_MODES_P
-+#define TARGET_ADDR_SPACE_DEFAULT_POINTER_ADDRESS_MODES_P \
-+  ix86_addr_space_default_pointer_address_modes_p
-+
-+/***** </AR> *****/
-+
-+
- /* Initialize the GCC target structure.  */
- #undef TARGET_RETURN_IN_MEMORY
- #define TARGET_RETURN_IN_MEMORY ix86_return_in_memory
-Index: gcc/config/i386/i386.h
-===================================================================
---- gcc/config/i386/i386.h	(revision 223859)
-+++ gcc/config/i386/i386.h	(working copy)
-@@ -2568,6 +2568,11 @@
- /* For switching between functions with different target attributes.  */
- #define SWITCHABLE_TARGET 1
- 
-+enum {
-+  ADDR_SPACE_SEG_FS = 1,
-+  ADDR_SPACE_SEG_GS = 2
-+};
-+
- /*
- Local variables:
- version-control: t


More information about the pypy-commit mailing list