[llvm-bugs] [Bug 34445] New: OpenMP: Reduction initializer segfaults at runtime in move constructor

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Sep 3 18:28:58 PDT 2017


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

            Bug ID: 34445
           Summary: OpenMP: Reduction initializer segfaults at runtime in
                    move constructor
           Product: clang
           Version: trunk
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: s6jaschu at uni-bonn.de
                CC: llvm-bugs at lists.llvm.org

I did compile the following program with "clang++ -fopenmp -std=c++14 test.cpp"
using a trunk build from a few days ago:

#include <cstdlib>
#include <functional>
#include <memory>

struct A {
  A() : ptr(nullptr, free) {}
  A& operator=(A&&) = default;
  std::unique_ptr<void, std::function<void(void*)>> ptr;
};

int main() {
  A test;
#pragma omp declare reduction(+ : A : omp_out) initializer(omp_priv = A())
#pragma omp parallel reduction(+ : test)
  {}
  return 0;
}

Running it results in a segmentation fault. I'm a little worried that this
could be a user error :/, sorry if this is the case.

GCC reports a missing copy constructor, the Intel compiler version runs.

-- 
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/20170904/89be4ccd/attachment-0001.html>


More information about the llvm-bugs mailing list