The __gthread_once_t struct should use aligned ints instead of chars. This allows the values to be manipulated on PowerPC using the stwcx and lwarx instructions (as is done in the vxTas() function call) without causing alignment issues. The fix is probably applicable to other architectures (SH4?) as well. --- old/gcc/gthr-vxworks.h 2006-08-22 09:26:05.000000000 -0400 +++ new/gcc/gthr-vxworks.h 2006-08-22 09:26:15.000000000 -0400 @@ -103,8 +103,8 @@ typedef struct { - volatile unsigned char busy; - volatile unsigned char done; + volatile unsigned int busy; + volatile unsigned int done; } __gthread_once_t;
Patch was submitted to gcc-patches earlier, which is the same as the patch already posted to the previous comment. http://gcc.gnu.org/ml/gcc-patches/2006-08/msg00786.html
Confirmed.
It appears that this one is fixed as of SVN revision 146566: http://gcc.gnu.org/viewcvs/trunk/gcc/gthr-vxworks.h?view=log
Fixed in r0-92956 .