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;


-- 
           Summary: Alignment problem in __gthread_once_t in vxWorks
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: atgraham at gmail dot com
GCC target triplet: powerpc-vxworks-elf


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28808

Reply via email to