This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2][malloc] Use relaxed atomics for malloc have_fastchunks


I think this breaks the build for tilepro.  You're using atomic operations 
on a bool field, and tilepro only supports atomic operations on 4-byte 
objects and gives errors for other sizes.  Generic code should only use 
atomics on int-size / pointer-size objects unless it knows the particular 
architecture supports atomics of other sizes (e.g. through 
__HAVE_64B_ATOMICS).

In file included from ../include/atomic.h:50:0,
                 from malloc.c:216:
malloc.c: In function 'malloc_init_state':
../sysdeps/tile/tilepro/atomic-machine.h:72:7: error: call to '__atomic_error_bad_argument_size' declared with attribute warning: bad sizeof atomic argument [-Werror]
       __atomic_error_bad_argument_size ();                              \
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../sysdeps/tile/tilepro/atomic-machine.h:78:3: note: in expansion of macro '__atomic_update'
   __atomic_update ((mem), 0, (newvalue))
   ^~~~~~~~~~~~~~~
../sysdeps/tile/tilepro/atomic-machine.h:94:40: note: in expansion of macro 'atomic_exchange_acq'
 #define atomic_store_relaxed(mem, val) atomic_exchange_acq (mem, val)
                                        ^~~~~~~~~~~~~~~~~~~
malloc.c:1818:3: note: in expansion of macro 'atomic_store_relaxed'
   atomic_store_relaxed (&av->have_fastchunks, false);
   ^~~~~~~~~~~~~~~~~~~~

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]