[llvm-bugs] [Bug 48686] New: OpenMPOpt is illegally removing calls

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jan 7 09:06:48 PST 2021


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

            Bug ID: 48686
           Summary: OpenMPOpt is illegally removing calls
           Product: new-bugs
           Version: 11.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: rscottmanley at gmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

The OpenMPOpt pass in opt is illegally removing the second call to
omp_get_level() in the source code below after the second call gets inlined.
Using -openmp-opt-disable resolves the issue. 

clang -O2 -fopenmp test.c 

#include <omp.h>
#include <assert.h>

int main()
{
    omp_set_nested(1);

    assert(omp_get_level() == 0);

    #pragma omp parallel if(0) num_threads(2)
    {
        assert(omp_get_level() == 1);
    }
}

I've confirmed this exists in both release/11.x and main branches

-- 
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/20210107/8efc4a89/attachment.html>


More information about the llvm-bugs mailing list