[pypy-commit] pypy stmgc-c7: Backed out changeset 4d93e7a10f91: gcc does some optimizations before

arigo noreply at buildbot.pypy.org
Sat May 30 09:04:03 CEST 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: stmgc-c7
Changeset: r77701:905ab5c077a5
Date: 2015-05-30 09:04 +0200
http://bitbucket.org/pypy/pypy/changeset/905ab5c077a5/

Log:	Backed out changeset 4d93e7a10f91: 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/rpython/translator/c/genc.py b/rpython/translator/c/genc.py
--- a/rpython/translator/c/genc.py
+++ b/rpython/translator/c/genc.py
@@ -439,7 +439,7 @@
             exe_name = targetdir.join(exe_name)
         kwds = {}
         if self.config.translation.stm:
-            kwds['cc'] = 'gcc-seg-gs'   # use the custom patched version of gcc
+            kwds['cc'] = 'clang'     # force the use of clang
         mk = self.translator.platform.gen_makefile(
             cfiles, self.eci,
             path=targetdir, exe_name=exe_name,
diff --git a/rpython/translator/stm/src_stm/revision b/rpython/translator/stm/src_stm/revision
--- a/rpython/translator/stm/src_stm/revision
+++ b/rpython/translator/stm/src_stm/revision
@@ -1,1 +1,1 @@
-a23e1117adb9
+84157d77ae80
diff --git a/rpython/translator/stm/src_stm/stm/core.c b/rpython/translator/stm/src_stm/stm/core.c
--- a/rpython/translator/stm/src_stm/stm/core.c
+++ b/rpython/translator/stm/src_stm/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/rpython/translator/stm/src_stm/stm/fprintcolor.c b/rpython/translator/stm/src_stm/stm/fprintcolor.c
--- a/rpython/translator/stm/src_stm/stm/fprintcolor.c
+++ b/rpython/translator/stm/src_stm/stm/fprintcolor.c
@@ -1,10 +1,8 @@
 /* Imported by rpython/translator/stm/import_stmgc.py */
-#include <stdarg.h>
 /* ------------------------------------------------------------ */
 #ifdef STM_DEBUGPRINT
 /* ------------------------------------------------------------ */
 
-
 static int threadcolor_printf(const char *format, ...)
 {
     char buffer[2048];
diff --git a/rpython/translator/stm/src_stm/stmgc.h b/rpython/translator/stm/src_stm/stmgc.h
--- a/rpython/translator/stm/src_stm/stmgc.h
+++ b/rpython/translator/stm/src_stm/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
@@ -349,6 +340,8 @@
    returns: it jumps back to the stm_start_transaction(). */
 void stm_abort_transaction(void) __attribute__((noreturn));
 
+/* Turn the current transaction inevitable.
+   The stm_become_inevitable() itself may still abort. */
 #ifdef STM_NO_AUTOMATIC_SETJMP
 int stm_is_inevitable(void);
 #else
@@ -356,10 +349,6 @@
     return !rewind_jmp_armed(&STM_SEGMENT->running_thread->rjthread);
 }
 #endif
-
-/* Turn the current transaction inevitable.
-   stm_become_inevitable() itself may still abort the transaction instead
-   of returning. */
 static inline void stm_become_inevitable(stm_thread_local_t *tl,
                                          const char* msg) {
     assert(STM_SEGMENT->running_thread == tl);
@@ -515,7 +504,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;                                    \
 })
 


More information about the pypy-commit mailing list