Skip to content

__builtin_assume_aligned not taken into account for __int128 __sync* diagnostics #69146

@tbaederr

Description

@tbaederr

Consider:

static inline void
atomic16_set(__int128 *ptr, __int128 val)
{
    __int128_t *ptr_align = __builtin_assume_aligned(ptr, 16);
    __int128_t old;

    __sync_bool_compare_and_swap_16(ptr_align, old, 0);
}

On s390, this causes a warning from codegen, because ptr_align is not "naturally aligned".

This was introduced in https://reviews.llvm.org/D143813.
Is the correct alignment for 128bit integers 8 byte or 16 byte on s390? Is the __builtin_assume_aligned being propagated and considered for the diagnostic or not?

See also: https://gitlab.com/qemu-project/qemu/-/issues/1934

CC @JonPsson @efriedma-quic

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions