Skip to content

unable to build zig with x86 backend using ReleaseFast optimization mode #17885

@andrewrk

Description

@andrewrk

1b0b46a

$ ./zig2 build --zig-lib-dir lib -Doptimize=ReleaseFast -Dstrip -Dno-langref -Dno-autodocs
zig build-exe zig ReleaseFast native: error: error(x86_64_encoder): no encoding found for: none mov m128 r64 none none
error(x86_64_encoder): no encoding found for: none mov m128 r64 none none
error(x86_64_encoder): no encoding found for: none mov m128 r64 none none
error(x86_64_encoder): no encoding found for: none mov m128 r64 none none
error(x86_64_encoder): no encoding found for: none mov m256 r64 none none
error(x86_64_encoder): no encoding found for: none mov m128 r64 none none
error(x86_64_encoder): no encoding found for: none mov m128 r64 none none
error(x86_64_encoder): no encoding found for: none mov m128 r64 none none
error(x86_64_encoder): no encoding found for: none mov m128 r64 none none

zig build-exe zig ReleaseFast native: error: the following command failed with 9 compilation errors:
/home/andy/Downloads/zig/zig2 build-exe --stack 33554432 /home/andy/Downloads/zig/src/main.zig -fstrip -OReleaseFast --cache-dir /home/andy/Downloads/zig/zig-cache --global-cache-dir /home/andy/.cache/zig --name zig --mod aro::/home/andy/Downloads/zig/deps/aro/lib.zig --mod build_options::/home/andy/Downloads/zig/zig-cache/c/b0a3e19e067b3b3c4957215274d0ade5/options.zig --deps aro,build_options --zig-lib-dir /home/andy/Downloads/zig/lib --listen=- 
Build Summary: 2/5 steps succeeded; 1 failed (disable with --summary none)
install transitive failure
└─ install zig transitive failure
   └─ zig build-exe zig ReleaseFast native 9 errors
deps/aro/Attribute.zig:1281:1: error: CodeGen failed to find a viable instruction. This is a bug in the Zig compiler.
fn applyAligned(attr: Attribute, p: *Parser, ty: Type, tag: ?Diagnostics.Tag) !void {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
deps/aro/Parser.zig:224:1: error: CodeGen failed to find a viable instruction. This is a bug in the Zig compiler.
fn validateExtendedIdentifier(p: *Parser) !bool {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
deps/aro/Parser.zig:7617:1: error: CodeGen failed to find a viable instruction. This is a bug in the Zig compiler.
fn parseNumberEscape(p: *Parser, tok: TokenIndex, base: u8, slice: []const u8, i: *usize) !u8 {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
deps/aro/Parser.zig:7634:1: error: CodeGen failed to find a viable instruction. This is a bug in the Zig compiler.
fn parseUnicodeEscape(p: *Parser, tok: TokenIndex, count: u8, slice: []const u8, i: *usize) !void {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
deps/aro/Attribute.zig:922:5: error: CodeGen failed to find a viable instruction. This is a bug in the Zig compiler.
pub fn initArguments(tag: Tag, name_tok: TokenIndex) Arguments {
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
deps/aro/Parser.zig:4240:1: error: CodeGen failed to find a viable instruction. This is a bug in the Zig compiler.
fn labeledStmt(p: *Parser) Error!?NodeIndex {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
deps/aro/Attribute.zig:223:5: error: CodeGen failed to find a viable instruction. This is a bug in the Zig compiler.
pub fn diagnoseAlignment(attr: Tag, arguments: *Arguments, arg_idx: u32, val: Value, ty: Type, comp: *Compilation) ?Diagnostics.Message {
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
deps/aro/Parser.zig:358:1: error: CodeGen failed to find a viable instruction. This is a bug in the Zig compiler.
fn errOverflow(p: *Parser, op_tok: TokenIndex, res: Result) !void {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
deps/aro/Parser.zig:7212:1: error: CodeGen failed to find a viable instruction. This is a bug in the Zig compiler.
fn checkArrayBounds(p: *Parser, index: Result, array: Result, tok: TokenIndex) !void {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

target CPU and OS info:

pub const cpu: std.Target.Cpu = .{
    .arch = .x86_64,
    .model = &std.Target.x86.cpu.skylake,
    .features = std.Target.x86.featureSet(&[_]std.Target.x86.Feature{
        .@"64bit",
        .adx,
        .aes,
        .allow_light_256_bit,
        .avx,
        .avx2,
        .bmi,
        .bmi2,
        .clflushopt,
        .cmov,
        .crc32,
        .cx16,
        .cx8,
        .ermsb,
        .f16c,
        .false_deps_popcnt,
        .fast_15bytenop,
        .fast_gather,
        .fast_scalar_fsqrt,
        .fast_shld_rotate,
        .fast_variable_crosslane_shuffle,
        .fast_variable_perlane_shuffle,
        .fast_vector_fsqrt,
        .fma,
        .fsgsbase,
        .fxsr,
        .idivq_to_divl,
        .invpcid,
        .lzcnt,
        .macrofusion,
        .mmx,
        .movbe,
        .no_bypass_delay_blend,
        .no_bypass_delay_mov,
        .no_bypass_delay_shuffle,
        .nopl,
        .pclmul,
        .popcnt,
        .prfchw,
        .rdrnd,
        .rdseed,
        .sahf,
        .sgx,
        .slow_3ops_lea,
        .sse,
        .sse2,
        .sse3,
        .sse4_1,
        .sse4_2,
        .ssse3,
        .vzeroupper,
        .x87,
        .xsave,
        .xsavec,
        .xsaveopt,
        .xsaves,
    }),
};
pub const os = std.Target.Os{
    .tag = .linux,
    .version_range = .{ .linux = .{
        .range = .{
            .min = .{
                .major = 6,
                .minor = 1,
                .patch = 53,
            },
            .max = .{
                .major = 6,
                .minor = 1,
                .patch = 53,
            },
        },
        .glibc = .{
            .major = 2,
            .minor = 36,
            .patch = 0,
        },
    }},
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-x86_6464-bit x86backend-self-hostedbugObserved behavior contradicts documented or intended behaviorenhancementSolving this issue will likely involve adding new logic or components to the codebase.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions