Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incorrect alignment of constants #1741

Closed
andrewrk opened this issue Nov 17, 2018 · 1 comment
Closed

incorrect alignment of constants #1741

andrewrk opened this issue Nov 17, 2018 · 1 comment
Labels
bug Observed behavior contradicts documented or intended behavior
Milestone

Comments

@andrewrk
Copy link
Member

const std = @import("std");

test "aou" {
    const x: f32 align(128) = 12.34;
    std.debug.assert(@ptrToInt(&x) % 128 == 0);
}
Test 1/1 aou...assertion failure
@andrewrk andrewrk added the bug Observed behavior contradicts documented or intended behavior label Nov 17, 2018
@andrewrk andrewrk added this to the 0.4.0 milestone Nov 17, 2018
@andrewrk andrewrk modified the milestones: 0.4.0, 0.5.0 Apr 8, 2019
@andrewrk
Copy link
Member Author

Fixed in master, regression test added, and I confirmed the const in the LLVM IR is getting the alignment:

@0 = internal unnamed_addr constant float 0x4028AE1480000000, align 128

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior
Projects
None yet
Development

No branches or pull requests

1 participant