[llvm-bugs] [Bug 50077] New: Clang 12.0.0 new ICE on templated C++ code involving OpenMP and lambda function

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Apr 22 07:37:56 PDT 2021


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

            Bug ID: 50077
           Summary: Clang 12.0.0 new ICE on templated C++ code involving
                    OpenMP and lambda function
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: kmccarty at gmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

Clang 12.0.0 crashes when trying to build a C++ file at my workplace having a
combination of OpenMP pragma, templates, and lambda function passed into the
template function.  Compilation was in C++17 mode.  I'll attach the relevant
files momentarily.

This is a regression -- version 10.0.1 compiled the file without issue.  I have
not tested with intermediate versions.

(Note, I selected "trunk" for the Version field since 12.0 is not yet available
as an option there.)


Some remarks follow on how the relevant Clang binaries were built from source,
which may or may not be relevant to the ICE.

The Clang 10.0.1 instance (that succeeds) was built from source on RedHat
Enterprise Linux 6.6 (yes ancient I know :-) using an instance of GCC 7.3 that
was also built on the same platform.  The compilation succeeds with this Clang
binary both on RHEL 6.6 and on RHEL 7.2 machines.

The Clang 12.0.0 instance (that crashes) was built from source on RHEL 7.2
using an instance of GCC 7.3 that was also built on RHEL 7.2.

In both cases, the Clang instance was compiled from the llvm-<version>.tar.xz,
clang-<version>.tar.xz and openmp-<version>.tar.xz source files.  Note that
they were compiled to use the GCC 7.3 instance's libstdc++ (libc++ is not
involved at all).  Relevant build configuration was in both cases as follows
with $VER having been set to 10.0.1 or 12.0.0 as appropriate:

export CXXFLAGS=-fno-strict-aliasing
cmake -G "Unix Makefiles" ../llvm-$VER.src \
        -DCMAKE_INSTALL_PREFIX=/usr/devsrc/llvm-$VER \
        -DCMAKE_C_COMPILER=/usr/local/gcc73/bin/gcc \
        -DCMAKE_CXX_COMPILER=/usr/local/gcc73/bin/g++ \
        -DCMAKE_BUILD_TYPE=Release \
        -DLLVM_TARGETS_TO_BUILD=X86 \
        -DOPENMP_ENABLE_LIBOMPTARGET=OFF \
        -DGCC_INSTALL_PREFIX=/usr/local/gcc73

N.B. I pass -DOPENMP_ENABLE_LIBOMPTARGET=OFF since otherwise 'nvcc' had errored
out during a previous build (of Clang 7), and I wasn't motivated enough to
figure out how to fix, nor to see if the problem was gone in later versions.
*** This does not prevent it from building libomp.so. ***

Cmake version used was 3.7.0 (hand-built) for the Clang 10.0.1 build, and
3.17.0 (again, hand-built) for the Clang 12.0.0 build.


In order to allow LLVM 12.0.0 to build on RHEL7, I had to modify its
CMakeLists.txt and two files under cmake/ in order to force it to use the
system Python 2.7.5, rather than using Python3 that the cmake files claim to
need but which the RHEL7 OS doesn't supply by default.  After this
modification, LLVM + Clang + OpenMP built and installed without complaint.  I
doubt that this is related to the ICE, since the Clang binary appeared to
compile the rest of our source code without issue, but I mention it in the
interests of completeness.

-- 
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/20210422/4603b88b/attachment.html>


More information about the llvm-bugs mailing list