Use union of AO_t and word for mse_descr to avoid type casting
authorIvan Maidanski <ivmai@mail.ru>
Sun, 29 Jan 2012 18:52:30 +0000 (22:52 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Sun, 29 Jan 2012 18:52:30 +0000 (22:52 +0400)
commit9ef4c276203929afd9a9e4c9796f2a04efbb740c
tree348572e0ac62f0ca4541d3fb608cedd7c471a44b
parent0589e7c42dc7c884c49081f829309ecccd1c63f0
Use union of AO_t and word for mse_descr to avoid type casting
(which breaks 'strict-aliasing' compiler optimization)

* include/private/gc_pmark.h (GC_ms_entry): Change type of mse_descr
from word to word_ptr_ao_u.
* include/private/gc_pmark.h (GC_mark_stack_top): Add FIXME.
* include/private/gc_pmark.h (OR_WORD_EXIT_IF_SET): Add 'volatile'
keyword to type cast for AO_or argument.
* include/private/gc_priv.h (counter_t): Add 'volatile' in case of
defining as AO_t (replace typedef with a macro).
* include/private/gc_priv.h (word_ptr_ao_u): New union type.
* include/private/gc_pmark.h (PUSH_OBJ): Add ".w" suffix to mse_descr.
* mark.c (GC_mark_from, GC_steal_mark_stack, GC_push_all): Likewise.
* mark.c (GC_steal_mark_stack): Use "ao" element of union to load and
clear mse_descr atomically; remove pointer type casts.
include/private/gc_pmark.h
include/private/gc_priv.h
mark.c
typd_mlc.c