flang
flang copied to clipboard
clang compiler error when flang using "-mcmodel=medium -fpic" and complex math
trafficstars
I have accidentally used together the options "-mcmodel=medium -fpic" on a code using complex arithmetic
program main
complex alpha,beta
read(5,*) alpha,beta
IF ((ALPHA.EQ.CMPLX(0.,0.)).OR.
X (BETA.EQ.CMPLX(1.,1.))) write(6,*) 'read zero and one'
stop
end
This result in the following compiler error. Let me know if this the right place to file an issue, since clang seems to be crashing and not flang
flang -mcmodel=medium -fpic program.f
clang-9: /home/amd/JENKINS/workspace/AOCC_2_1_0/llvm/include/llvm/Support/Casting.h:105: static bool llvm::isa_impl_cl<To, const From*>::doit(const From*) [with To = llvm::Function; From = llvm::GlobalValue]: Assertion `Val && "isa<> used on a null pointer"' failed.
Stack dump:
0. Program arguments: /home/edo/apps/aocc-compiler-2.1.0/bin/clang-9 -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name pp.f -mrelocation-model pic -pic-level 1 -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -mcode-model medium -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -resource-dir /home/edo/apps/aocc-compiler-2.1.0/lib/clang/9.0.0 -fdebug-compilation-dir /tmp -ferror-limit 19 -fmessage-length 0 -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -itodcalls -itodcallsbyclone -faddrsig -o /tmp/pp-eb04a8.o -x ir /tmp/pp-35b269.ll
1. Code generation
2. Running pass 'Function Pass Manager' on module '/tmp/pp-35b269.ll'.
3. Running pass 'X86 DAG->DAG Instruction Selection' on function '@MAIN_'
#0 0x00007f3c48aefb8a llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/home/edo/apps/aocc-compiler-2.1.0/bin/../lib/libLLVM-9.so+0x854b8a)
#1 0x00007f3c48aeda8a llvm::sys::RunSignalHandlers() (/home/edo/apps/aocc-compiler-2.1.0/bin/../lib/libLLVM-9.so+0x852a8a)
#2 0x00007f3c48aedbb9 SignalHandler(int) (/home/edo/apps/aocc-compiler-2.1.0/bin/../lib/libLLVM-9.so+0x852bb9)
#3 0x00007f3c4808e890 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
#4 0x00007f3c44164e97 raise /build/glibc-OTsEL5/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
#5 0x00007f3c44166801 abort /build/glibc-OTsEL5/glibc-2.27/stdlib/abort.c:81:0
#6 0x00007f3c4415639a __assert_fail_base /build/glibc-OTsEL5/glibc-2.27/assert/assert.c:89:0
#7 0x00007f3c44156412 (/lib/x86_64-linux-gnu/libc.so.6+0x30412)
#8 0x00007f3c4894805c llvm::TargetTransformInfoImplBase::getCallCost(llvm::FunctionType*, int, llvm::User const*) (.isra.111.part.112) (/home/edo/apps/aocc-compiler-2.1.0/bin/../lib/libLLVM-9.so+0x6ad05c)
#9 0x00007f3c4a5cdfad (/home/edo/apps/aocc-compiler-2.1.0/bin/../lib/libLLVM-9.so+0x2332fad)
#10 0x00007f3c4a4b0abe llvm::X86TargetLowering::LowerConstantPool(llvm::SDValue, llvm::SelectionDAG&) const (/home/edo/apps/aocc-compiler-2.1.0/bin/../lib/libLLVM-9.so+0x2215abe)
#11 0x00007f3c4a563358 llvm::X86TargetLowering::LowerOperation(llvm::SDValue, llvm::SelectionDAG&) const (/home/edo/apps/aocc-compiler-2.1.0/bin/../lib/libLLVM-9.so+0x22c8358)
#12 0x00007f3c4911f3de (anonymous namespace)::SelectionDAGLegalize::LegalizeOp(llvm::SDNode*) (.part.285) (/home/edo/apps/aocc-compiler-2.1.0/bin/../lib/libLLVM-9.so+0xe843de)
#13 0x00007f3c491308c2 llvm::SelectionDAG::Legalize() (/home/edo/apps/aocc-compiler-2.1.0/bin/../lib/libLLVM-9.so+0xe958c2)
#14 0x00007f3c4925ec9e llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/home/edo/apps/aocc-compiler-2.1.0/bin/../lib/libLLVM-9.so+0xfc3c9e)
#15 0x00007f3c492678ed llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/home/edo/apps/aocc-compiler-2.1.0/bin/../lib/libLLVM-9.so+0xfcc8ed)
#16 0x00007f3c4926979f llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (.part.780.constprop.806) (/home/edo/apps/aocc-compiler-2.1.0/bin/../lib/libLLVM-9.so+0xfce79f)
#17 0x00007f3c4a4743ff (anonymous namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/home/edo/apps/aocc-compiler-2.1.0/bin/../lib/libLLVM-9.so+0x21d93ff)
#18 0x00007f3c48e3c606 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.25.constprop.26) (/home/edo/apps/aocc-compiler-2.1.0/bin/../lib/libLLVM-9.so+0xba1606)
#19 0x00007f3c48c13deb llvm::FPPassManager::runOnFunction(llvm::Function&) (/home/edo/apps/aocc-compiler-2.1.0/bin/../lib/libLLVM-9.so+0x978deb)
#20 0x00007f3c48c13fb4 llvm::FPPassManager::runOnModule(llvm::Module&) (/home/edo/apps/aocc-compiler-2.1.0/bin/../lib/libLLVM-9.so+0x978fb4)
#21 0x00007f3c48c14991 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/home/edo/apps/aocc-compiler-2.1.0/bin/../lib/libLLVM-9.so+0x979991)
#22 0x00007f3c461006c7 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/edo/apps/aocc-compiler-2.1.0/bin/../lib/libclang-cpp.so.9+0x12536c7)
#23 0x00007f3c4636bbba clang::CodeGenAction::ExecuteAction() (/home/edo/apps/aocc-compiler-2.1.0/bin/../lib/libclang-cpp.so.9+0x14bebba)
#24 0x00007f3c46980eb9 clang::FrontendAction::Execute() (/home/edo/apps/aocc-compiler-2.1.0/bin/../lib/libclang-cpp.so.9+0x1ad3eb9)
#25 0x00007f3c46941dd2 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/home/edo/apps/aocc-compiler-2.1.0/bin/../lib/libclang-cpp.so.9+0x1a94dd2)
#26 0x00007f3c469ef313 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/home/edo/apps/aocc-compiler-2.1.0/bin/../lib/libclang-cpp.so.9+0x1b42313)
#27 0x0000000000413450 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/home/edo/apps/aocc-compiler-2.1.0/bin/clang-9+0x413450)
#28 0x000000000040d5ed main (/home/edo/apps/aocc-compiler-2.1.0/bin/clang-9+0x40d5ed)
#29 0x00007f3c44147b97 __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:344:0
#30 0x000000000040ea6e _start (/home/edo/apps/aocc-compiler-2.1.0/bin/clang-9+0x40ea6e)
clang-9: error: unable to execute command: Aborted (core dumped)
clang-9: error: clang frontend command failed due to signal (use -v to see invocation)
AOCC.LLVM.2.1.0.B1030.2019_11_12 clang version 9.0.0 (CLANG: Build#1030) (based on LLVM AOCC.LLVM.2.1.0.B1030.2019_11_12)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/edo/apps/aocc-compiler-2.1.0/bin
clang-9: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
clang-9: note: diagnostic msg: Error generating preprocessed source(s) - no preprocessable inputs.