[llvm-bugs] [Bug 35152] New: `Scope.hasEHBranches() == (EHEntry != nullptr)' assertion with openmp reproducer:

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Oct 31 13:54:43 PDT 2017


            Bug ID: 35152
           Summary: `Scope.hasEHBranches() == (EHEntry != nullptr)'
                    assertion with openmp reproducer:
           Product: OpenMP
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Clang Compiler Support
          Assignee: unassignedclangbugs at nondot.org
          Reporter: erich.keane at intel.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 19366
  --> https://bugs.llvm.org/attachment.cgi?id=19366&action=edit
Repro file, command line

See repro file, taken from our internal test suite.  Only happens with -O1 for
some reason, and ONLY with a windows target, but it is reproduceable with a
Linux host (see command line in the repro).

Also, copied and pasted here for convenience: 
//clang -cc1 -triple x86_64-pc-windows-msvc18.0.0 -emit-obj repro.cpp
-fexceptions -fcxx-exceptions -std=c++11 -fms-compatibility-version=18 -fopenmp
-fms-extensions -O1

void printf(const char*);
void exit(int);

struct Test {
    static void main() {
        int failed = 0;
        int j = 2;

        #pragma omp parallel
            int local_j = 3;
            #pragma omp single copyprivate(local_j)
                local_j = 4;

            // Assure reports a data race, but value written to "j"
            // should always be the same.
            j = local_j;

        if(j != 4) failed = 1;

        if(failed) {
            printf("Test " __FILE__ " failed\n");
        } else {
            printf("Test " __FILE__ " passed\n");

int main() {
    return 0;

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/20171031/7768e740/attachment-0001.html>

More information about the llvm-bugs mailing list