Skip to content

[Flang][OpenMP] Compilation error of ordered construct not in DO loops #65570

@yus3710-fj

Description

@yus3710-fj

This is an issue from Fujitsu testsuite.

Flang-new terminates abnormally when compiling ordered clause not in DO loops.

The following are the test program, Flang-new and gfortran compilation result.

! test.f90 subroutine sub() implicit none integer::i integer::k=0 !$omp ordered do i=1,1 k=k+1 enddo !$omp end ordered end
$ flang-new -v test.f90 -c -fopenmp flang-new version 18.0.0 (https://github.com/llvm/llvm-project.git 701e6f7630474b637e0bc45d009bf2ec47f2d3fd) Target: aarch64-unknown-linux-gnu Thread model: posix InstalledDir: /path/to/install/bin Found candidate GCC installation: /usr/lib/gcc/aarch64-redhat-linux/8 Selected GCC installation: /usr/lib/gcc/aarch64-redhat-linux/8 Candidate multilib: .;@m64 Selected multilib: .;@m64  "/path/to/install/bin/flang-new" -fc1 -triple aarch64-unknown-linux-gnu -emit-obj -fopenmp -fcolor-diagnostics -mrelocation-model pic -pic-level 2 -pic-is-pie -target-cpu generic -target-feature +neon -target-feature +v8a -o test.o -x f95-cpp-input test.f90 error: loc("/path/to/test.f90":6:1): failed to legalize operation 'cf.br' error: Lowering to LLVM IR failed error: loc("/path/to/test.f90":1:1): cannot be converted to LLVM IR: missing `LLVMTranslationDialectInterface` registration for dialect for op: func.func error: failed to create the LLVM module PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace. Stack dump: 0. Program arguments: /path/to/install/bin/flang-new -fc1 -triple aarch64-unknown-linux-gnu -emit-obj -fopenmp -fcolor-diagnostics -mrelocation-model pic -pic-level 2 -pic-is-pie -target-cpu generic -target-feature +neon -target-feature +v8a -o test.o -x f95-cpp-input test.f90  #0 0x0000ffff87285f60 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/path/to/install/bin/../lib/libLLVMSupport.so.18git+0x1a5f60)  #1 0x0000ffff87283b40 llvm::sys::RunSignalHandlers() (/path/to/install/bin/../lib/libLLVMSupport.so.18git+0x1a3b40)  #2 0x0000ffff87283cb0 SignalHandler(int) Signals.cpp:0:0  #3 0x0000ffff88d6066c (linux-vdso.so.1+0x66c)  #4 0x0000ffff87f702c0 Fortran::frontend::CodeGenAction::executeAction() (/path/to/install/bin/../lib/libflangFrontend.so.18git+0x1202c0)  #5 0x0000ffff87ea2b2c Fortran::frontend::FrontendAction::execute() (/path/to/install/bin/../lib/libflangFrontend.so.18git+0x52b2c)  #6 0x0000ffff87e943c4 Fortran::frontend::CompilerInstance::executeAction(Fortran::frontend::FrontendAction&) (/path/to/install/bin/../lib/libflangFrontend.so.18git+0x443c4)  #7 0x0000ffff883f3bbc Fortran::frontend::executeCompilerInvocation(Fortran::frontend::CompilerInstance*) (/path/to/install/bin/../lib/libflangFrontendTool.so.18git+0x3bbc)  #8 0x00000000004048dc fc1_main(llvm::ArrayRef<char const*>, char const*) (/path/to/install/bin/flang-new+0x4048dc)  #9 0x0000000000403108 main (/path/to/install/bin/flang-new+0x403108) #10 0x0000ffff86c50d64 __libc_start_main (/lib64/libc.so.6+0x20d64) #11 0x00000000004035d0 _start (/path/to/install/bin/flang-new+0x4035d0) flang-new: error: unable to execute command: Segmentation fault (core dumped) flang-new: error: flang frontend command failed due to signal (use -v to see invocation) flang-new version 18.0.0 (https://github.com/llvm/llvm-project.git 701e6f7630474b637e0bc45d009bf2ec47f2d3fd) Target: aarch64-unknown-linux-gnu Thread model: posix InstalledDir: /path/to/install/bin flang-new: note: diagnostic msg:  ******************** PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: flang-new: note: diagnostic msg: /tmp/test-506a7f flang-new: note: diagnostic msg: /tmp/test-506a7f.sh flang-new: note: diagnostic msg:  ********************
$ gfortran -v test.f90 -c -fopenmp Using built-in specs. COLLECT_GCC=gfortran Target: aarch64-redhat-linux Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --disable-libmpx --enable-gnu-indirect-function --build=aarch64-redhat-linux Thread model: posix gcc version 8.4.1 20200928 (Red Hat 8.4.1-1) (GCC)   : $

Metadata

Metadata

Assignees

No one assigned

    Labels

    crashPrefer [crash-on-valid] or [crash-on-invalid]flang:iropenmp

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions