# define GC_INLINE static
#endif
+#ifndef GC_ATTR_NOINLINE
+# if __GNUC__ >= 4
+# define GC_ATTR_NOINLINE __attribute__((__noinline__))
+# elif _MSC_VER >= 14
+# define GC_ATTR_NOINLINE __declspec(noinline)
+# else
+# define GC_ATTR_NOINLINE /* empty */
+# endif
+#endif
+
#ifndef GC_API_OSCALL
/* This is used to identify GC routines called by name from OS. */
# if defined(__GNUC__)
/* Make arguments appear live to compiler. Put here to minimize the */
/* risk of inlining. Used to minimize junk left in registers. */
+GC_ATTR_NOINLINE
void GC_noop6(word arg1 GC_ATTR_UNUSED, word arg2 GC_ATTR_UNUSED,
word arg3 GC_ATTR_UNUSED, word arg4 GC_ATTR_UNUSED,
word arg5 GC_ATTR_UNUSED, word arg6 GC_ATTR_UNUSED)
{
- /* Empty */
+ /* Avoid GC_noop6 calls to be optimized away. */
+# if defined(GC_PTHREADS) && !defined(GC_WIN32_THREADS) \
+ || defined(PARALLEL_MARK)
+ AO_compiler_barrier(); /* to serve as a special side-effect */
+# else
+ GC_noop1(0);
+# endif
}
/* Single argument version, robust against whole program analysis. */