[Bug libgomp/105358] [12 Regression] scan* fails on targets without aligned memory allocators.

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Apr 25 11:19:28 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105358

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
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)
?


More information about the Gcc-bugs mailing list