Skip to content

x86_64 backend genSetReg called with a value larger than dst_reg #24181

Open
@leecannon

Description

@leecannon

Zig Version

0.15.0-dev.784+4a02e080d

Steps to Reproduce and Observed Behavior

$ git clone https://github.com/leecannon/zig-coreutils.git
$ cd zig-coreutils
$ git checkout x86_backend_bug
$ zig build test_linux
test_linux
└─ run test_zig-coreutils-linux
   └─ compile test test_zig-coreutils-linux Debug native-linux 3 errors
src/system/backend/FileSystem.zig:226:5: error: genSetReg called with a value larger than dst_reg
pub fn readAllFile(self: *FileSystem, ptr: *anyopaque, buffer: []u8) usize {
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/system/backend/FileSystem.zig:147:5: error: genSetReg called with a value larger than dst_reg
pub fn createFile(
~~~~^~
src/system/backend/FileSystem.zig:14:5: error: genSetReg called with a value larger than dst_reg
pub fn init(self: *FileSystem, backend: *TestBackend, description: *const FileSystemDescription) !void {
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: the following command failed with 3 compilation errors:
/home/lee/.local/share/zigup/0.15.0-dev.784+4a02e080d/files/zig test -ODebug -target native-linux -mcpu native --dep options --dep tracy --dep tracy_impl=impl_disabled --dep target_os -Mroot=/home/lee/zig-coreutils/src/main.zig -Moptions=.zig-cache/c/1f48bd123fd13860e374a2dcc8d194fc/options.zig -ODebug -target native-linux -mcpu native --dep impl_disabled -Mtracy=/home/lee/.cache/zig/p/tracy-0.0.0-R7l8BdlCAQBFp6uysnan3Alaxap65HBF1mzGdabdKe8z/src/root.zig -ODebug -target native-linux -mcpu native -Mimpl_disabled=/home/lee/.cache/zig/p/tracy-0.0.0-R7l8BdlCAQBFp6uysnan3Alaxap65HBF1mzGdabdKe8z/src/impl_disabled.zig -Mtarget_os=.zig-cache/c/e2bba7f371dd4abf5e9e60893592e5bf/options.zig --cache-dir .zig-cache --global-cache-dir /home/lee/.cache/zig --name test_zig-coreutils-linux --zig-lib-dir /home/lee/.local/share/zigup/0.15.0-dev.784+4a02e080d/files/lib/ --listen=-
Build Summary: 3/6 steps succeeded; 1 failed
test_linux transitive failure
└─ run test_zig-coreutils-linux transitive failure
   └─ compile test test_zig-coreutils-linux Debug native-linux 3 errors
error: the following build command failed with exit code 1:
.zig-cache/o/cf5bfc65b6b3b8689a99902500473db6/build /home/lee/.local/share/zigup/0.15.0-dev.784+4a02e080d/files/zig /home/lee/.local/share/zigup/0.15.0-dev.784+4a02e080d/files/lib /home/lee/zig-coreutils .zig-cache /home/lee/.cache/zig --seed 0x65ea4f65 -Zbae65a7c33646694 test_linux

Similar to #20122 but still reproduces.

Expected Behavior

Builds fine like when use_llvm is true.

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-x86_6464-bit x86backend-self-hostedbugObserved behavior contradicts documented or intended behavior

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions