[llvm-bugs] [Bug 46730] New: Invalid OpenMP loop code causes crash

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jul 15 08:06:25 PDT 2020


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

            Bug ID: 46730
           Summary: Invalid OpenMP loop code causes crash
           Product: OpenMP
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Clang Compiler Support
          Assignee: unassignedclangbugs at nondot.org
          Reporter: rofirrim at gmail.com
                CC: llvm-bugs at lists.llvm.org

The following invalid OpenMP code crashes clang when using `-fopenmp`

  class S {
      public:
      operator int();
      S& operator+=(int);
  };

  int main() {
      S s1;
      #pragma omp taskloop
      for (S s = S(); s < s1; s += 1)
      {}
  }

Curiously `parallel for` does not fail so perhaps the observed crash is due to
something related to task constructs.

However both gcc and icc reject this loop (including the equivalent `[parallel
]for`) so it looks like clang should reject it too. My understanding is that
variables of class `S` are not random access iterators.

Kind regards,

-- 
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/20200715/936ae1f4/attachment-0001.html>


More information about the llvm-bugs mailing list