public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libgomp/102838] [12 regression] Several tests SEGV in gomp_loop_ull_init
Date: Wed, 20 Oct 2021 07:40:32 +0000	[thread overview]
Message-ID: <bug-102838-4-BGUQFb8BlV@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-102838-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:c7abdf46fb7ac9a0c37f120feff3fcc3a752584f

commit r12-4529-gc7abdf46fb7ac9a0c37f120feff3fcc3a752584f
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Oct 20 09:34:51 2021 +0200

    openmp: Fix up struct gomp_work_share handling [PR102838]

    If GOMP_HAVE_EFFICIENT_ALIGNED_ALLOC is not defined, the intent was to
    treat the split of the structure between first cacheline (64 bytes)
    as mostly write-once, use afterwards and second cacheline as rw just
    as an optimization.  But as has been reported, with vectorization enabled
    at -O2 it can now result in aligned vector 16-byte or larger stores.
    When not having posix_memalign/aligned_alloc/memalign or other similar API,
    alloc.c emulates it but it needs to allocate extra memory for the dynamic
    realignment.
    So, for the GOMP_HAVE_EFFICIENT_ALIGNED_ALLOC not defined case, this patch
    stops using aligned (64) attribute in the middle of the structure and
instead
    inserts padding that puts the second half of the structure at offset 64
bytes.

    And when GOMP_HAVE_EFFICIENT_ALIGNED_ALLOC is defined, usually it was
allocated
    as aligned, but for the orphaned case it could still be allocated just with
    gomp_malloc without guaranteed proper alignment.

    2021-10-20  Jakub Jelinek  <jakub@redhat.com>

            PR libgomp/102838
            * libgomp.h (struct gomp_work_share_1st_cacheline): New type.
            (struct gomp_work_share): Only use aligned(64) attribute if
            GOMP_HAVE_EFFICIENT_ALIGNED_ALLOC is defined, otherwise just
            add padding before lock to ensure lock is at offset 64 bytes
            into the structure.
            (gomp_workshare_struct_check1, gomp_workshare_struct_check2):
            New poor man's static assertions.
            * work.c (gomp_work_share_start): Use gomp_aligned_alloc instead of
            gomp_malloc if GOMP_HAVE_EFFICIENT_ALIGNED_ALLOC.

  parent reply	other threads:[~2021-10-20  7:40 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-19 13:03 [Bug libgomp/102838] New: " ro at gcc dot gnu.org
2021-10-19 13:03 ` [Bug libgomp/102838] " ro at gcc dot gnu.org
2021-10-19 13:12 ` jakub at gcc dot gnu.org
2021-10-19 14:01 ` jakub at gcc dot gnu.org
2021-10-19 14:22 ` jakub at gcc dot gnu.org
2021-10-20  7:40 ` cvs-commit at gcc dot gnu.org [this message]
2021-10-20 13:21 ` jakub at gcc dot gnu.org
2021-10-20 13:43 ` ro at CeBiTec dot Uni-Bielefeld.DE
2021-10-21 14:09 ` ro at CeBiTec dot Uni-Bielefeld.DE
2021-10-21 14:16 ` jakub at gcc dot gnu.org
2021-10-21 14:22 ` ro at CeBiTec dot Uni-Bielefeld.DE
2021-10-21 14:23 ` ro at gcc dot gnu.org
2021-10-21 14:37 ` jakub at gcc dot gnu.org
2021-11-08 10:16 ` tschwinge at gcc dot gnu.org
2021-11-16 11:19 ` jakub at gcc dot gnu.org
2021-11-17 12:08 ` ro at CeBiTec dot Uni-Bielefeld.DE
2021-11-17 12:38 ` jakub at gcc dot gnu.org
2021-11-17 13:05 ` ro at CeBiTec dot Uni-Bielefeld.DE
2021-11-18  8:10 ` cvs-commit at gcc dot gnu.org
2021-11-18  8:15 ` cvs-commit at gcc dot gnu.org
2021-11-18 12:12 ` jakub at gcc dot gnu.org
2021-11-19 12:12 ` ro at gcc dot gnu.org
2021-11-19 15:32 ` jakub at gcc dot gnu.org
2021-11-23 12:35 ` ro at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-102838-4-BGUQFb8BlV@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).