Skip to content

Inline asm: =m constraint on uninitialized object variable in impl block causes the SelectionDAGBuilder to crash rustc with SIGSEGV on Linux and 0xC0000005 on Windows #71701

Closed
@kennystrawnmusic

Description

@kennystrawnmusic

I tried this code:

//*snip*
/// Struct to store data from all registers in, in event of context switch
#[derive(Debug, Clone, Copy)]
pub struct ContextStore {
    pub rax: usize,
    pub rbx: usize,
    pub rcx: usize,
    pub rdx: usize,
    pub rdi: usize,
    pub rsi: usize,
    pub rbp: usize,
    pub rsp: usize,
    pub r8: usize,
    pub r9: usize,
    pub r10: usize,
    pub r11: usize,
    pub r12: usize,
    pub r13: usize,
    pub r14: usize,
    pub r15: usize,
    pub rip: usize,
    pub rflags: usize,
    pub cs: usize,
    pub ss: usize,
    pub fs: usize,
    pub gs: usize,
    pub fpu_buf: usize, //was giving me problems when attempting to assign as [u8; 512]
    pub avx_buf: usize, //could hold either SSE or AVX depending on what's supported
}

impl ContextStore {

    /// Copy data from all registers, including stack and instruction pointers, into Context instance
    pub fn backup() -> ContextStore {
        let reg_rax: usize;
        let reg_rbx: usize;
        let reg_rcx: usize;
        let reg_rdx: usize;
        let reg_rdi: usize;
        let reg_rsi: usize;
        let reg_rbp: usize;
        let reg_rsp: usize;
        let reg_r8: usize;
        let reg_r9: usize;
        let reg_r10: usize;
        let reg_r11: usize;
        let reg_r12: usize;
        let reg_r13: usize;
        let reg_r14: usize;
        let reg_r15: usize;
        let reg_rip: usize;
        let reg_rflags: usize;
        let reg_cs: usize;
        let reg_ss: usize;
        let reg_fs: usize;
        let reg_gs: usize;
        let fxdest: usize;
        let xdest: usize;

        unsafe {
            llvm_asm!("
                mov %rax, $1"
                :"=r"(reg_rax) ::: "volatile"
            );

            llvm_asm!("
                mov %rbx, $1"
                :"=r"(reg_rbx) ::: "volatile"
            );

            llvm_asm!("
                mov %rcx, $1"
                :"=r"(reg_rcx) ::: "volatile"
            );

            llvm_asm!("
                mov %rdx, $1"
                :"=r"(reg_rdx) ::: "volatile"
            );

            llvm_asm!("
                mov %rdi, $1"
                :"=r"(reg_rdi) ::: "volatile"
            );

            llvm_asm!("
                mov %rsi, $1"
                :"=r"(reg_rsi) ::: "volatile"
            );

            llvm_asm!("
                mov %rbp, $1"
                :"=r"(reg_rbp) ::: "volatile"
            );

            llvm_asm!("
                mov %rsp, $1"
                :"=r"(reg_rsp) ::: "volatile"
            );

            llvm_asm!("
                mov %r8, $1"
                :"=r"(reg_r8) ::: "volatile"
            );

            llvm_asm!("
                mov %r9, $1"
                :"=r"(reg_r9) ::: "volatile"
            );

            llvm_asm!("
                mov %r10, $1"
                :"=r"(reg_r10) ::: "volatile"
            );

            llvm_asm!("
                mov %r11, $1"
                :"=r"(reg_r11) ::: "volatile"
            );

            llvm_asm!("
                mov %r12, $1"
                :"=r"(reg_r12) ::: "volatile"
            );

            llvm_asm!("
                mov %r13, $1"
                :"=r"(reg_r13) ::: "volatile"
            );

            llvm_asm!("
                mov %r14, $1"
                :"=r"(reg_r14) ::: "volatile"
            );

            llvm_asm!("
                mov %r15, $1"
                :"=r"(reg_r15) ::: "volatile"
            );

            llvm_asm!("
                mov %rip, $1"
                :"=r"(reg_rip) ::: "volatile"
            );

            llvm_asm!("
                mov %rflags, $1"
                :"=r"(reg_rflags) ::: "volatile"
            );

            llvm_asm!("
                mov %cs, $1"
                :"=r"(reg_cs) ::: "volatile"
            );

            llvm_asm!("
                mov %ss, $1"
                :"=r"(reg_ss) ::: "volatile"
            );

            llvm_asm!("
                mov %fs, $1"
                :"=r"(reg_fs) ::: "volatile"
            );

            llvm_asm!("
                mov %gs, $1"
                :"=r"(reg_gs) ::: "volatile"
            );

            llvm_asm!("
                fxsave $0"
                :"=m"(fxdest)
            );

            llvm_asm!("
                xsave $0"
                :"=m"(xdest)
            );
        }

        ContextStore {
            rax: reg_rax,
            rbx: reg_rbx,
            rcx: reg_rcx,
            rdx: reg_rdx,
            rdi: reg_rdi,
            rsi: reg_rsi,
            rbp: reg_rbp,
            rsp: reg_rsp,
            r8: reg_r8,
            r9: reg_r9,
            r10: reg_r10,
            r11: reg_r11,
            r12: reg_r12,
            r13: reg_r13,
            r14: reg_r14,
            r15: reg_r15,
            rip: reg_rip,
            rflags: reg_rflags,
            cs: reg_cs,
            ss: reg_ss,
            fs: reg_fs,
            gs: reg_gs,
            fpu_buf: fxdest,
            avx_buf: xdest,
        }
    }

    /// Same as backup(), but mutable for testing purposes. Unsafe for obvious reasons.
    pub unsafe fn backup_as_mut() -> ContextStore {
        let mut reg_rax: usize;
        let mut reg_rbx: usize;
        let mut reg_rcx: usize;
        let mut reg_rdx: usize;
        let mut reg_rdi: usize;
        let mut reg_rsi: usize;
        let mut reg_rbp: usize;
        let mut reg_rsp: usize;
        let mut reg_r8: usize;
        let mut reg_r9: usize;
        let mut reg_r10: usize;
        let mut reg_r11: usize;
        let mut reg_r12: usize;
        let mut reg_r13: usize;
        let mut reg_r14: usize;
        let mut reg_r15: usize;
        let mut reg_rip: usize;
        let mut reg_rflags: usize;
        let mut reg_cs: usize;
        let mut reg_ss: usize;
        let mut reg_fs: usize;
        let mut reg_gs: usize;
        let mut fxdest: usize;
        let mut xdest: usize;

        //Don't know why the compiler is warning about this; llvm_asm! is definitely unsafe
        #[allow(unused_unsafe)]
        unsafe {
            llvm_asm!("
                mov %rax, $1"
                :"=r"(reg_rax) ::: "volatile"
            );

            llvm_asm!("
                mov %rbx, $1"
                :"=r"(reg_rbx) ::: "volatile"
            );

            llvm_asm!("
                mov %rcx, $1"
                :"=r"(reg_rcx) ::: "volatile"
            );

            llvm_asm!("
                mov %rdx, $1"
                :"=r"(reg_rdx) ::: "volatile"
            );

            llvm_asm!("
                mov %rdi, $1"
                :"=r"(reg_rdi) ::: "volatile"
            );

            llvm_asm!("
                mov %rsi, $1"
                :"=r"(reg_rsi) ::: "volatile"
            );

            llvm_asm!("
                mov %rbp, $1"
                :"=r"(reg_rbp) ::: "volatile"
            );

            llvm_asm!("
                mov %rsp, $1"
                :"=r"(reg_rsp) ::: "volatile"
            );

            llvm_asm!("
                mov %r8, $1"
                :"=r"(reg_r8) ::: "volatile"
            );

            llvm_asm!("
                mov %r9, $1"
                :"=r"(reg_r9) ::: "volatile"
            );

            llvm_asm!("
                mov %r10, $1"
                :"=r"(reg_r10) ::: "volatile"
            );

            llvm_asm!("
                mov %r11, $1"
                :"=r"(reg_r11) ::: "volatile"
            );

            llvm_asm!("
                mov %r12, $1"
                :"=r"(reg_r12) ::: "volatile"
            );

            llvm_asm!("
                mov %r13, $1"
                :"=r"(reg_r13) ::: "volatile"
            );

            llvm_asm!("
                mov %r14, $1"
                :"=r"(reg_r14) ::: "volatile"
            );

            llvm_asm!("
                mov %r15, $1"
                :"=r"(reg_r15) ::: "volatile"
            );

            llvm_asm!("
                mov %rip, $1"
                :"=r"(reg_rip) ::: "volatile"
            );

            llvm_asm!("
                mov %rflags, $1"
                :"=r"(reg_rflags) ::: "volatile"
            );

            llvm_asm!("
                mov %cs, $1"
                :"=r"(reg_cs) ::: "volatile"
            );

            llvm_asm!("
                mov %ss, $1"
                :"=r"(reg_ss) ::: "volatile"
            );

            llvm_asm!("
                mov %fs, $1"
                :"=r"(reg_fs) ::: "volatile"
            );

            llvm_asm!("
                mov %gs, $1"
                :"=r"(reg_gs) ::: "volatile"
            );

            llvm_asm!("
                fxsave $0"
                :"=m"(fxdest)
            );

            llvm_asm!("
                xsave $0"
                :"=m"(xdest)
            );
        }

        #[allow(unused_mut)]
        let mut c_stor = ContextStore {
            rax: reg_rax,
            rbx: reg_rbx,
            rcx: reg_rcx,
            rdx: reg_rdx,
            rdi: reg_rdi,
            rsi: reg_rsi,
            rbp: reg_rbp,
            rsp: reg_rsp,
            r8: reg_r8,
            r9: reg_r9,
            r10: reg_r10,
            r11: reg_r11,
            r12: reg_r12,
            r13: reg_r13,
            r14: reg_r14,
            r15: reg_r15,
            rip: reg_rip,
            rflags: reg_rflags,
            cs: reg_cs,
            ss: reg_ss,
            fs: reg_fs,
            gs: reg_gs,
            fpu_buf: fxdest,
            avx_buf: xdest,
        };
        c_stor //return this
    }

    /// Copy data from Context instance provided as method argument into all registers, including stack and instruction pointers
    pub fn restore(ctx: ContextStore) {

        unsafe {

            llvm_asm!("
                mov $0, %rax"
                :
                : "{rax}"(ctx.rax) :: "volatile"
            );

            llvm_asm!("
                mov $0, %rbx"
                :
                : "{rbx}"(ctx.rbx) :: "volatile"
            );

            llvm_asm!("
                mov $0, %rcx"
                :
                : "{rcx}"(ctx.rcx) :: "volatile"
            );

            llvm_asm!("
                mov $0, %rdx"
                :
                : "{rdx}"(ctx.rdx) :: "volatile"
            );

            llvm_asm!("
                mov $0, %rdi"
                :
                : "{rdi}"(ctx.rdi) :: "volatile"
            );

            llvm_asm!("
                mov $0, %rsi"
                :
                : "{rsi}"(ctx.rsi) :: "volatile"
            );

            llvm_asm!("
                mov $0, %rbp"
                :
                : "{rbp}"(ctx.rbp) :: "volatile"
            );

            llvm_asm!("
                mov $0, %rsp"
                :
                : "{rsp}"(ctx.rsp) :: "volatile"
            );

            llvm_asm!("
                mov $0, %r8"
                :
                : "{r8}"(ctx.r8) :: "volatile"
            );

            llvm_asm!("
                mov $0, %r9"
                :
                : "{r9}"(ctx.r9) :: "volatile"
            );

            llvm_asm!("
                mov $0, %r10"
                :
                : "{r10}"(ctx.r10) :: "volatile"
            );

            llvm_asm!("
                mov $0, %r11"
                :
                : "{r11}"(ctx.r11) :: "volatile"
            );

            llvm_asm!("
                mov $0, %r12"
                :
                : "{r12}"(ctx.r12) :: "volatile"
            );

            llvm_asm!("
                mov $0, %r13"
                :
                : "{r13}"(ctx.r13) :: "volatile"
            );

            llvm_asm!("
                mov $0, %r14"
                :
                : "{r14}"(ctx.r14) :: "volatile"
            );

            llvm_asm!("
                mov $0, %r15"
                :
                : "{r15}"(ctx.r15) :: "volatile"
            );

            llvm_asm!("
                mov $0, %rip"
                :
                : "{rip}"(ctx.rip) :: "volatile"
            );

            llvm_asm!("
                mov $0, %rflags"
                :
                : "{rflags}"(ctx.rflags) :: "volatile"
            );

            llvm_asm!("
                mov $0, %cs"
                :
                : "{cs}"(ctx.cs) :: "volatile"
            );

            llvm_asm!("
                mov $0, %ss"
                :
                : "{cs}"(ctx.ss) :: "volatile"
            );

            llvm_asm!("
                mov $0, %fs"
                :
                : "{fs}"(ctx.fs) :: "volatile"
            );

            llvm_asm!("
                mov $0, %gs"
                :
                : "{gs}"(ctx.gs) :: "volatile"
            );

            llvm_asm!("
                fxrstor $0"
                :
                : "m"(ctx.fpu_buf)
            );

            llvm_asm!("
                xrstor $0"
                :
                : "m"(ctx.avx_buf)
            );
        }
    }
}
//*snip*

I expected to see this happen:

I get it, that's a lot of inline assembly, but also highly necessary if you're developing an OS ― and backing up registers to initiate a context switch is one of those areas in which developers have no choice but to get down and dirty.

So, using cargo bootimage ― which definitely worked before I wrote this code ― shouldn't be a problem here, especially given that there are plenty of crates out there that serve, to a degree, as safe abstractions. If the inline assembly has any syntax problems in it (reversed $1 and $0 for example which might be the case here) then the compiler should throw an error, not crash.

Instead, this happened:

No compiler errors are output, but the compiler crashes ― with, exactly as the title says, a segmentation fault, using an Arch Linux host.

Here's the GDB output ― and this is using the copied-and-pasted arguments that cargo bootimage is passing down to rustc whenever I try to build this project:

 sudo gdb /opt/rust/bin/rustc
GNU gdb (GDB) 9.1
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /opt/rust/bin/rustc...
(gdb) set args --crate-name foundation --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -Cbitcode-in-rlib=no -C debuginfo=2 -C metadata=43bb5f9c010d384a -C extra-filename=-43bb5f9c010d384a --out-dir /home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps --target /home/realkstrawn93/Desktop/foundation/foundation.json -C incremental=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/incremental -L dependency=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps -L dependency=/home/realkstrawn93/Desktop/foundation/target/debug/deps --extern acpi=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps/libacpi-2468ed628f48cc96.rlib --extern bootloader=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps/libbootloader-9cc0e1fe6e171121.rlib --extern conquer_once=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps/libconquer_once-c97aa096525a92d5.rlib --extern crossbeam_queue=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps/libcrossbeam_queue-b1977b968e889611.rlib --extern embedded_graphics=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps/libembedded_graphics-1a0e2418ea24d543.rlib --extern embedded_hal=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps/libembedded_hal-2a0341aff3027e3a.rlib --extern futures=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps/libfutures-5a4e74d4cf36b338.rlib --extern lazy_static=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps/liblazy_static-75eb22ceac96cc86.rlib --extern linked_list_allocator=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps/liblinked_list_allocator-f207ac3a6355d05d.rlib --extern pc_keyboard=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps/libpc_keyboard-fdb3a18b96a076fd.rlib --extern pic8259_simple=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps/libpic8259_simple-c3975024e57f481b.rlib --extern raw_cpuid=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps/libraw_cpuid-c7af727af4bd4ba0.rlib --extern spin=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps/libspin-49552fecbc548142.rlib --extern tinypci=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps/libtinypci-2049d2f725a17edf.rlib --extern uart_16550=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps/libuart_16550-2592cdbc4cace607.rlib --extern volatile=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps/libvolatile-b5909b2d587908c7.rlib --extern x86_64=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps/libx86_64-3e58c4978b5c685f.rlib --sysroot /home/realkstrawn93/Desktop/foundation/target/sysroot
(gdb) run
Starting program: /opt/rust/bin/rustc --crate-name foundation --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -Cbitcode-in-rlib=no -C debuginfo=2 -C metadata=43bb5f9c010d384a -C extra-filename=-43bb5f9c010d384a --out-dir /home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps --target /home/realkstrawn93/Desktop/foundation/foundation.json -C incremental=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/incremental -L dependency=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps -L dependency=/home/realkstrawn93/Desktop/foundation/target/debug/deps --extern acpi=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps/libacpi-2468ed628f48cc96.rlib --extern bootloader=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps/libbootloader-9cc0e1fe6e171121.rlib --extern conquer_once=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps/libconquer_once-c97aa096525a92d5.rlib --extern crossbeam_queue=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps/libcrossbeam_queue-b1977b968e889611.rlib --extern embedded_graphics=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps/libembedded_graphics-1a0e2418ea24d543.rlib --extern embedded_hal=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps/libembedded_hal-2a0341aff3027e3a.rlib --extern futures=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps/libfutures-5a4e74d4cf36b338.rlib --extern lazy_static=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps/liblazy_static-75eb22ceac96cc86.rlib --extern linked_list_allocator=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps/liblinked_list_allocator-f207ac3a6355d05d.rlib --extern pc_keyboard=--Type <RET> for more, q to quit, c to continue without paging--
/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps/libpc_keyboard-fdb3a18b96a076fd.rlib --extern pic8259_simple=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps/libpic8259_simple-c3975024e57f481b.rlib --extern raw_cpuid=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps/libraw_cpuid-c7af727af4bd4ba0.rlib --extern spin=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps/libspin-49552fecbc548142.rlib --extern tinypci=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps/libtinypci-2049d2f725a17edf.rlib --extern uart_16550=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps/libuart_16550-2592cdbc4cace607.rlib --extern volatile=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps/libvolatile-b5909b2d587908c7.rlib --extern x86_64=/home/realkstrawn93/Desktop/foundation/target/foundation/debug/deps/libx86_64-3e58c4978b5c685f.rlib --sysroot /home/realkstrawn93/Desktop/foundation/target/sysroot
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
process 291019 is executing new program: /opt/rust/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffef3ff700 (LWP 291023)]
[New Thread 0x7fffecdff700 (LWP 291024)]
[Thread 0x7fffecdff700 (LWP 291024) exited]
[New Thread 0x7fffecdff700 (LWP 291026)]
[New Thread 0x7fffe743b700 (LWP 291027)]
[New Thread 0x7fffe6dff700 (LWP 291028)]
[Thread 0x7fffe6dff700 (LWP 291028) exited]
[New Thread 0x7fffe6dff700 (LWP 291029)]
[New Thread 0x7fffe65ff700 (LWP 291030)]
[Thread 0x7fffe6dff700 (LWP 291029) exited]
[New Thread 0x7fffe6dff700 (LWP 291031)]
[New Thread 0x7fffe5b7f700 (LWP 291032)]
[Thread 0x7fffe65ff700 (LWP 291030) exited]
[New Thread 0x7fffe65ff700 (LWP 291033)]
[Thread 0x7fffe6dff700 (LWP 291031) exited]
[New Thread 0x7fffe6dff700 (LWP 291034)]
[Thread 0x7fffe5b7f700 (LWP 291032) exited]
[Thread 0x7fffe65ff700 (LWP 291033) exited]
[New Thread 0x7fffe65ff700 (LWP 291035)]
[Thread 0x7fffe6dff700 (LWP 291034) exited]
[New Thread 0x7fffe6dff700 (LWP 291036)]
[New Thread 0x7fffe5b7f700 (LWP 291037)]
[New Thread 0x7fffe53ff700 (LWP 291038)]
[Thread 0x7fffe5b7f700 (LWP 291037) exited]
[Thread 0x7fffe6dff700 (LWP 291036) exited]
[Thread 0x7fffe65ff700 (LWP 291035) exited]
[New Thread 0x7fffe5b7f700 (LWP 291039)]
[Thread 0x7fffe53ff700 (LWP 291038) exited]
[New Thread 0x7fffe53ff700 (LWP 291040)]
[Thread 0x7fffe5b7f700 (LWP 291039) exited]
[New Thread 0x7fffe5b7f700 (LWP 291041)]
--Type <RET> for more, q to quit, c to continue without paging--

Thread 19 "rustc" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffe5b7f700 (LWP 291041)]
0x00007ffff1cb7b1e in llvm::SelectionDAGBuilder::visitInlineAsm(llvm::ImmutableCallSite) ()
   from /opt/rust/toolchains/nightly-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-9-rust-1.45.0-nightly.so

Note that it's actually rustc itself that's segfaulting here ― this here is why I didn't file any bug reports with the cargo-bootimage crate maintainers: cargo bootimage invokes rustc to actually do the compiling, using a custom set of parameters that the above gdb output is preserving for posterity.

Also, the instruction that rustc is segfaulting in ― again, according to GDB ― is very clearly a line of LLVM inline assembly parsing code: llvm::SelectionDAGBuilder::visitInlineAsm(llvm::ImmutableCallSite) ()

Since this is really the only part of my project in which I use any inline assembly at all (the x86_64 crate is of great help elsewhere), I am fairly confident that the problem here is that something in Rust's LLVM implementation just can't handle this much inline assembly at one time. Hopefully there's a way to improve this upstream.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-inline-assemblyArea: Inline assembly (`asm!(…)`)C-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions