a simple full barrier ? static int chnget_opcode_perf_k(CSOUND *csound, CHNGET *p) { #ifdef HAVE_ATOMIC_BUILTIN __sync_synchronize(); #endif *(p->arg) = *(p->fp); return OK; } On Thu, Aug 22, 2013 at 03:01:35PM -0400, Steven Yi wrote: > I'm assuming that the pd lib I'm building will also fail then. Not > sure of a solution either. > > On Thu, Aug 22, 2013 at 1:56 PM, Victor Lazzarini > wrote: > > No, but for the moment, I am not doing i386 anymore. > > On 22 Aug 2013, at 16:28, Steven Yi wrote: > > > >> Have you tried compiling with clang? I've had problems with the > >> atomic stuff on Windows i386, but that was in linking. (Didn't even > >> get to runtime. :P ). > >> > >> On Thu, Aug 22, 2013 at 6:56 AM, Victor Lazzarini > >> wrote: > >>> It appears that there is a problem with _sync_fetch_and_add in the i386 architecture. I am > >>> get segfaults at bus.c:586 > >>> > >>> Program received signal EXC_BAD_ACCESS, Could not access memory. > >>> Reason: KERN_PROTECTION_FAILURE at address: 0x00000000 > >>> 0x0003fe98 in chnget_opcode_perf_k (csound=0x800000, p=0x894a78) at /Users/victor/src/csound6/OOps/bus.c:586 > >>> 586 x.i = __sync_fetch_and_add((MYFLT_INT_TYPE *) p->fp, 0); > >>> > >>> Compiling without any optimisation appears to stop the segfault, and the code seems to work. So if it was > >>> the case that the intrinsic did not exist for int64_t in i386, it would not suddenly start to work. > >>> > >>> Not sure how to solve this. > >>> > >>> gcc version 4.2.1 (Apple Inc. build 5666) > >>> > >>> Dr Victor Lazzarini > >>> Senior Lecturer > >>> Dept. of Music > >>> NUI Maynooth Ireland > >>> tel.: +353 1 708 3545 > >>> Victor dot Lazzarini AT nuim dot ie > >>> ------------------------------------------------------------------------------ Introducing Performance Central, a new site from SourceForge and AppDynamics. Performance Central is your source for news, insights, analysis and resources for efficient Application Performance Management. Visit us today! http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net