https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105358
--- Comment #6 from Iain Sandoe <iains at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #4) > Still trying to understand where the problem is. > In work.c (gomp_init_work_share), there are 3 cases, one is ordered == 0, > another one ordered == 1, another one bigger numbers. The first one doesn't > care, > ordered_team_ids is initialized to inline_ordered_team_ids just to make sure > we don't try to team_free it, isn't really used. For ordered == 1 case, we > only use the trailing array as array of unsigned and most likely in the > darwin9 case not at all, because I expect INLINE_ORDERED_TEAM_IDS_SIZE to be > 0 or 4 or something that small. > For the ordered > 1 case (used when some memory needs to be allocated after > the > ordered_teams_ids array and that one should be possibly 8-byte aligned) it > adds extra __alignof__ (long long) - 1 to the size but undoes that if > nthreads is even and inline_ordered_team_ids is at position divisible by 8. > > So, guess some question, can you e.g. from dumping DWARF on work.o find out: > sizeof (struct gomp_init_work_share) > offsetof (struct gomp_init_work_share, inline_ordered_team_ids) > ? (sorry for being slow here, meetings...) so 0xac = 172 .. and therefore as you expected INLINE_ORDERED_TEAM_IDS_SIZE = 0 (that's on a 8 core / 16 thread machine) 0x00000dc5: TAG_structure_type [22] * AT_name( "gomp_work_share" ) AT_byte_size( 0xac ) AT_decl_file( "/src-local/gcc-master/libgomp/libgomp.h" ) AT_decl_line( 288 ) AT_decl_column( 0x08 ) AT_sibling( {0x00000f0a} ) 0x00000ee4: TAG_member [23] AT_name( "inline_ordered_team_ids" ) AT_decl_file( "/src-local/gcc-master/libgomp/libgomp.h" ) AT_decl_line( 395 ) AT_decl_column( 0x0c ) AT_type( {0x00001051} ( unsigned int[] ) ) AT_data_member_location( +172 )