[llvm-bugs] [Bug 48919] New: kmp_settings.cpp fails to compile on Windows with error C2131: expression did not evaluate to a constant

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jan 28 03:28:34 PST 2021


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

            Bug ID: 48919
           Summary: kmp_settings.cpp fails to compile on Windows with
                    error C2131: expression did not evaluate to a constant
           Product: OpenMP
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Runtime Library
          Assignee: unassignedbugs at nondot.org
          Reporter: hans at chromium.org
                CC: llvm-bugs at lists.llvm.org
            Blocks: 48902

in a VS 2019 x86 Native Tools Command Prompt

with llvmorg-12.0.0-rc1 checked out

cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON
-DLLVM_ENABLE_PROJECTS="clang;openmp" ..\llvm
ninja omp

C:\src\llvm.monorepo\openmp\runtime\src\kmp_settings.cpp(3358): error C2131:
expression did not evaluate to a constant
C:\src\llvm.monorepo\openmp\runtime\src\kmp_settings.cpp(3358): note: failure
was caused by a read of a variable outside its lifetime
C:\src\llvm.monorepo\openmp\runtime\src\kmp_settings.cpp(3358): note: see usage
of 'ntraits'


Bisection points to


commit 927af4b3c57681e623b8449fb717a447559358d0
Author: Nawrin Sultana <nawrin.sultana at intel.com>
Date:   Mon Nov 2 16:17:37 2020 -0600

    [OpenMP] Modify OMP_ALLOCATOR environment variable

    This patch sets the def-allocator-var ICV based on the environment
variables
    provided in OMP_ALLOCATOR. Previously, only allowed value for OMP_ALLOCATOR
    was a predefined memory allocator. OpenMP 5.1 specification allows
predefined
    memory allocator, predefined mem space, or predefined mem space with traits
in
    OMP_ALLOCATOR. If an allocator can not be created using the provided
environment
    variables, the def-allocator-var is set to omp_default_mem_alloc.

    Differential Revision: https://reviews.llvm.org/D94985

 openmp/runtime/src/kmp_settings.cpp       | 391 ++++++++++++++++++++++++------
 openmp/runtime/test/env/omp51_alloc_env.c |  31 +++
 2 files changed, 353 insertions(+), 69 deletions(-)
 create mode 100644 openmp/runtime/test/env/omp51_alloc_env.c



As of this morning the same error happens on the main branch too.


Referenced Bugs:

https://bugs.llvm.org/show_bug.cgi?id=48902
[Bug 48902] [meta] 12.0.0 Release Blockers
-- 
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/20210128/2dc7c99a/attachment.html>


More information about the llvm-bugs mailing list