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

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

https://gcc.gnu.org/g:04df5e7de2f3dd652a9cddc1c9adfbdf45947ae6

commit r11-2909-g04df5e7de2f3dd652a9cddc1c9adfbdf45947ae6
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Thu Aug 27 18:44:40 2020 +0200

    ia32: Fix alignment of _Atomic fields [PR65146]

    For _Atomic fields, lowering the alignment of long long or double etc.
    fields on ia32 is undesirable, because then one really can't perform atomic
    operations on those using cmpxchg8b.

    The following patch stops lowering the alignment in fields for _Atomic
    types (the x86_field_alignment change) and for -mpreferred-stack-boundary=2
    also ensures we don't misalign _Atomic long long etc. automatic variables
    (the ix86_{local,minimum}_alignment changes).
    Not sure about iamcu_alignment change, I know next to nothing about IA MCU,
    but unless it doesn't have cmpxchg8b instruction, it would surprise me if
we
    don't want to do it as well.
    clang apparently doesn't lower the field alignment for _Atomic.

    2020-08-27  Jakub Jelinek  <ja...@redhat.com>

            PR target/65146
            * config/i386/i386.c (iamcu_alignment): Don't decrease alignment
            for TYPE_ATOMIC types.
            (ix86_local_alignment): Likewise.
            (ix86_minimum_alignment): Likewise.
            (x86_field_alignment): Likewise, and emit a -Wpsabi diagnostic
            for it.

            * gcc.target/i386/pr65146.c: New test.

Reply via email to