Skip to content

wrong C ABI for @alignOf(@Vector(4, f32)) on arm #12137

@xxxbxxx

Description

@xxxbxxx

Zig Version

0.10.0-dev.3008

Steps to Reproduce

There seem to be a special case in the ABI for arm (and armeb, thumb, thumbeb) with a reduced alignment for 16-bytes vectors.

empirically:
https://godbolt.org/z/ca6G58G19

but I don't know the exact rules.

Expected Behavior

@alignOf(@Vector(4, f32))==8
@alignOf(@Vector(16, i8))==8

Actual Behavior

@alignOf(@Vector(4, f32))==16
@alignOf(@Vector(16, i8))==16

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-arm32-bit ARMbugObserved behavior contradicts documented or intended behaviorfrontendTokenization, parsing, AstGen, Sema, and Liveness.miscompilationThe compiler reports success but produces semantically incorrect code.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions