Open boxofbytes opened 1 year ago
With recent main:
Assertion failed: (!MFI.hasCalls() || (StackSize % 16) == 8), function getFrameIndexReference, file /home/dim/src/llvm/llvm-project/llvm/lib/Target/X86/X86FrameLowering.cpp, line 2569.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /home/dim/ins/llvmorg-18-init-04777-g869111ccf2d/bin/clang -cc1 -triple x86_64-unknown-windows-msvc19.20.0 -emit-obj -mincremental-linker-compatible -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name interrupts.cpp -mrelocation-model pic -pic-level 2 -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -ffreestanding -target-cpu x86-64 -disable-red-zone -mllvm -x86-asm-syntax=intel -inline-asm=intel -tune-cpu generic -mllvm -treat-scalable-fixed-error-as-warning -fcoverage-compilation-dir=/home/marko/osdev/gatOS -O3 -Wattributes -Wall -Wextra -fdeprecated-macro -fdebug-compilation-dir=/home/marko/osdev/gatOS -ferror-limit 19 -fwchar-type=short -fno-signed-wchar -fno-use-cxa-atexit -fms-extensions -fms-compatibility -fms-compatibility-version=19.20 -std=c++14 -fdelayed-template-parsing -fcxx-exceptions -fexceptions -fcolor-diagnostics -vectorize-loops -vectorize-slp -faddrsig -x c++ interrupts-a151f4.cpp
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module 'interrupts-a151f4.cpp'.
4. Running pass 'Prologue/Epilogue Insertion & Frame Finalization' on function '@"?exception_isr_0@@YAXPEAUinterrupt_frame@interrupts@os@@_K@Z"'
#0 0x00000000044bc537 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/dim/ins/llvmorg-18-init-04777-g869111ccf2d/bin/clang+0x44bc537)
#1 0x00000000044ba2a8 llvm::sys::RunSignalHandlers() (/home/dim/ins/llvmorg-18-init-04777-g869111ccf2d/bin/clang+0x44ba2a8)
#2 0x00000000044bccf0 SignalHandler(int) Signals.cpp:0:0
#3 0x0000000828051a3e handle_signal /usr/src/lib/libthr/thread/thr_sig.c:0:3
#4 0x0000000828050ff9 thr_sighandler /usr/src/lib/libthr/thread/thr_sig.c:247:1
#5 0x0000000827d8b903 ([vdso]+0x2d3)
#6 0x000000082dceb97a __sys_thr_kill /usr/obj/usr/src/lib/libc/thr_kill.S:4:0
#7 0x000000082dc64954 __raise /usr/src/lib/libc/gen/raise.c:0:10
#8 0x000000082dd153e9 abort /usr/src/lib/libc/stdlib/abort.c:73:17
#9 0x000000082dc47a41 (/lib/libc.so.7+0x93a41)
#10 0x00000000034e5a9f llvm::X86FrameLowering::getFrameIndexReference(llvm::MachineFunction const&, int, llvm::Register&) const X86FrameLowering.cpp:0:0
#11 0x00000000034e0b6a llvm::X86FrameLowering::emitPrologue(llvm::MachineFunction&, llvm::MachineBasicBlock&) const X86FrameLowering.cpp:0:0
#12 0x0000000003d9ff43 (anonymous namespace)::PEI::runOnMachineFunction(llvm::MachineFunction&) PrologEpilogInserter.cpp:0:0
#13 0x0000000003a3ec59 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/home/dim/ins/llvmorg-18-init-04777-g869111ccf2d/bin/clang+0x3a3ec59)
#14 0x0000000003fcdde5 llvm::FPPassManager::runOnFunction(llvm::Function&) (/home/dim/ins/llvmorg-18-init-04777-g869111ccf2d/bin/clang+0x3fcdde5)
#15 0x0000000003fd6061 llvm::FPPassManager::runOnModule(llvm::Module&) (/home/dim/ins/llvmorg-18-init-04777-g869111ccf2d/bin/clang+0x3fd6061)
#16 0x0000000003fce8a6 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/home/dim/ins/llvmorg-18-init-04777-g869111ccf2d/bin/clang+0x3fce8a6)
#17 0x0000000004c0420a clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::__1::unique_ptr<llvm::raw_pwrite_stream, std::__1::default_delete<llvm::raw_pwrite_stream>>) (/home/dim/ins/llvmorg-18-init-04777-g869111ccf2d/bin/clang+0x4c0420a)
#18 0x0000000005094dc8 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) CodeGenAction.cpp:0:0
#19 0x0000000005e91fd5 clang::ParseAST(clang::Sema&, bool, bool) (/home/dim/ins/llvmorg-18-init-04777-g869111ccf2d/bin/clang+0x5e91fd5)
#20 0x0000000004fb87c3 clang::FrontendAction::Execute() (/home/dim/ins/llvmorg-18-init-04777-g869111ccf2d/bin/clang+0x4fb87c3)
#21 0x0000000004f4142f clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/home/dim/ins/llvmorg-18-init-04777-g869111ccf2d/bin/clang+0x4f4142f)
#22 0x000000000508d096 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/home/dim/ins/llvmorg-18-init-04777-g869111ccf2d/bin/clang+0x508d096)
#23 0x0000000002a5f028 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/home/dim/ins/llvmorg-18-init-04777-g869111ccf2d/bin/clang+0x2a5f028)
#24 0x0000000002a5c284 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#25 0x0000000002a5b298 clang_main(int, char**, llvm::ToolContext const&) (/home/dim/ins/llvmorg-18-init-04777-g869111ccf2d/bin/clang+0x2a5b298)
Abort trap
Note that gcc gives a lot of these errors:
./src/common/interrupts/interrupts.cpp: In function 'void exception_isr_0(os::interrupts::interrupt_frame*, long long unsigned int)':
./src/common/interrupts/interrupts.cpp:61:138: sorry, unimplemented: SSE instructions aren't allowed in an exception service routine
./src/common/interrupts/interrupts.cpp: In function 'void set_exception_isr_0()':
./src/common/interrupts/interrupts.cpp:61:754: sorry, unimplemented: SSE instructions aren't allowed in a function with the 'no_caller_saved_registers' attribute
./src/common/interrupts/interrupts.cpp: In function 'void exception_isr_1(os::interrupts::interrupt_frame*, long long unsigned int)':
./src/common/interrupts/interrupts.cpp:62:138: sorry, unimplemented: SSE instructions aren't allowed in an exception service routine
./src/common/interrupts/interrupts.cpp: In function 'void set_exception_isr_1()':
...
Reduced:
// clang -cc1 -triple x86_64-unknown-windows-msvc19.20.0 -emit-obj interrupts-min.cpp
struct interrupt_frame {
void set_entry(int, int, int, int);
} idt;
[[gnu::interrupt]] void exception_isr_1(interrupt_frame *, unsigned long long) {
idt.set_entry(1, 1, 1, 1);
}
@llvm/issue-subscribers-backend-x86
I was doing my OS development work, but clang crashes when I dont put the
-mno-sse
flag for some reason. It compiles fine without any crashes or errors If I do put it though. Command line log (from the start of the errors until the diagnostic msg note): commandlinelog.txt Preprocessed source: interrupts-a151f4.cpp.txt Run script: interrupts-a151f4.sh.txt