[llvm-bugs] [Bug 52294] New: Fatal error for 32-bit pointer address space

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Oct 25 07:40:26 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=52294

            Bug ID: 52294
           Summary: Fatal error for 32-bit pointer address space
           Product: libraries
           Version: 12.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: akhuang at google.com
          Reporter: ararmine2 at gmail.com
                CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    llvm-dev at redking.me.uk, pengfei.wang at intel.com,
                    spatel+llvm at rotateright.com

LLVM crashes in back-end for the following code using __ptr32 attribute:

extern "C" {
  int printf(const char *, ...);
}

struct {short string_length; char string_text[128];} * __ptr32 a_comment;

int main()
{
  printf ("%s\n",a_comment->string_text);
}

run test with the following command:
clang test.cpp -S -target x86_64-windows-msvc -fms-extensions

Here is the crash:

fatal error: error in backend: Cannot emit physreg copy instruction
Stack dump:
0.  Program arguments: clang test.cpp -S -target x86_64-windows-msvc
-fms-extensions
1.  <eof> parser at end of file
2.  Code generation
3.  Running pass 'Function Pass Manager' on module 'test.cpp'.
4.  Running pass 'Post-RA pseudo instruction expansion pass' on function
'@"?commout@@YAXXZ"'
 #0 0x000055ef10000c8e llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/armine/llvm/llvm-10.0.1/llvm-project-10.0.1/release_build/bin/clang-10+0x1958c8e)
 #1 0x000055ef0fffe9d4 llvm::sys::RunSignalHandlers()
(/home/armine/llvm/llvm-10.0.1/llvm-project-10.0.1/release_build/bin/clang-10+0x19569d4)
 #2 0x000055ef0fffec51 llvm::sys::CleanupOnSignal(unsigned long)
(/home/armine/llvm/llvm-10.0.1/llvm-project-10.0.1/release_build/bin/clang-10+0x1956c51)
 #3 0x000055ef0ff7a548 llvm::CrashRecoveryContext::HandleExit(int)
(/home/armine/llvm/llvm-10.0.1/llvm-project-10.0.1/release_build/bin/clang-10+0x18d2548)
 #4 0x000055ef0fff789b llvm::sys::Process::Exit(int)
(/home/armine/llvm/llvm-10.0.1/llvm-project-10.0.1/release_build/bin/clang-10+0x194f89b)
 #5 0x000055ef0eff2d87 LLVMErrorHandler(void*, std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&, bool)
(/home/armine/llvm/llvm-10.0.1/llvm-project-10.0.1/release_build/bin/clang-10+0x94ad87)
 #6 0x000055ef0ff80dbb llvm::report_fatal_error(llvm::Twine const&, bool)
(/home/armine/llvm/llvm-10.0.1/llvm-project-10.0.1/release_build/bin/clang-10+0x18d8dbb)
 #7 0x000055ef0ff80f06
(/home/armine/llvm/llvm-10.0.1/llvm-project-10.0.1/release_build/bin/clang-10+0x18d8f06)
 #8 0x000055ef0f1ce47d
llvm::X86InstrInfo::copyPhysReg(llvm::MachineBasicBlock&,
llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>, llvm::DebugLoc
const&, llvm::MCRegister, llvm::MCRegister, bool) const
(/home/armine/llvm/llvm-10.0.1/llvm-project-10.0.1/release_build/bin/clang-10+0xb2647d)
 #9 0x000055ef0f70e6a6 (anonymous
namespace)::ExpandPostRA::runOnMachineFunction(llvm::MachineFunction&)
(/home/armine/llvm/llvm-10.0.1/llvm-project-10.0.1/release_build/bin/clang-10+0x10666a6)
#10 0x000055ef0f5cff1c
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/home/armine/llvm/llvm-10.0.1/llvm-project-10.0.1/release_build/bin/clang-10+0xf27f1c)
#11 0x000055ef0f9c6748 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/armine/llvm/llvm-10.0.1/llvm-project-10.0.1/release_build/bin/clang-10+0x131e748)
#12 0x000055ef0f9c7d09 llvm::FPPassManager::runOnModule(llvm::Module&)
(/home/armine/llvm/llvm-10.0.1/llvm-project-10.0.1/release_build/bin/clang-10+0x131fd09)
#13 0x000055ef0f9c80d0 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/armine/llvm/llvm-10.0.1/llvm-project-10.0.1/release_build/bin/clang-10+0x13200d0)
#14 0x000055ef1026117c clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout
const&, llvm::Module*, clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
(/home/armine/llvm/llvm-10.0.1/llvm-project-10.0.1/release_build/bin/clang-10+0x1bb917c)
#15 0x000055ef10e5d809
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/home/armine/llvm/llvm-10.0.1/llvm-project-10.0.1/release_build/bin/clang-10+0x27b5809)
#16 0x000055ef11a92aa1 clang::ParseAST(clang::Sema&, bool, bool)
(/home/armine/llvm/llvm-10.0.1/llvm-project-10.0.1/release_build/bin/clang-10+0x33eaaa1)
#17 0x000055ef10838e49 clang::FrontendAction::Execute()
(/home/armine/llvm/llvm-10.0.1/llvm-project-10.0.1/release_build/bin/clang-10+0x2190e49)
#18 0x000055ef107f072b
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/armine/llvm/llvm-10.0.1/llvm-project-10.0.1/release_build/bin/clang-10+0x214872b)
#19 0x000055ef1090f6eb
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/armine/llvm/llvm-10.0.1/llvm-project-10.0.1/release_build/bin/clang-10+0x22676eb)
#20 0x000055ef0eff3424 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*)
(/home/armine/llvm/llvm-10.0.1/llvm-project-10.0.1/release_build/bin/clang-10+0x94b424)
#21 0x000055ef0eff128a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
(/home/armine/llvm/llvm-10.0.1/llvm-project-10.0.1/release_build/bin/clang-10+0x94928a)
#22 0x000055ef106ba8c9 void llvm::function_ref<void
()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const::'lambda'()>(long)
(/home/armine/llvm/llvm-10.0.1/llvm-project-10.0.1/release_build/bin/clang-10+0x20128c9)
#23 0x000055ef0ff7a3c7
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
(/home/armine/llvm/llvm-10.0.1/llvm-project-10.0.1/release_build/bin/clang-10+0x18d23c7)
#24 0x000055ef106bb4de
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const (.part.0)
(/home/armine/llvm/llvm-10.0.1/llvm-project-10.0.1/release_build/bin/clang-10+0x20134de)
#25 0x000055ef10691efc
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const
(/home/armine/llvm/llvm-10.0.1/llvm-project-10.0.1/release_build/bin/clang-10+0x1fe9efc)
#26 0x000055ef106927f9
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
(/home/armine/llvm/llvm-10.0.1/llvm-project-10.0.1/release_build/bin/clang-10+0x1fea7f9)
#27 0x000055ef1069a57f
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(/home/armine/llvm/llvm-10.0.1/llvm-project-10.0.1/release_build/bin/clang-10+0x1ff257f)
#28 0x000055ef0ef84bfe main
(/home/armine/llvm/llvm-10.0.1/llvm-project-10.0.1/release_build/bin/clang-10+0x8dcbfe)
#29 0x00007f5dd3f290b3 __libc_start_main
/build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:342:3
#30 0x000055ef0eff0e6e _start
(/home/armine/llvm/llvm-10.0.1/llvm-project-10.0.1/release_build/bin/clang-10+0x948e6e)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20211025/a8a57b2b/attachment.html>


More information about the llvm-bugs mailing list