[llvm-bugs] [Bug 45959] New: SIMD & reduction on signed types emits sign-conversion diagnostic

via llvm-bugs llvm-bugs at lists.llvm.org
Sun May 17 10:07:55 PDT 2020


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

            Bug ID: 45959
           Summary: SIMD & reduction on signed types emits sign-conversion
                    diagnostic
           Product: OpenMP
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Clang Compiler Support
          Assignee: unassignedclangbugs at nondot.org
          Reporter: clang at evan.coeusgroup.com
                CC: llvm-bugs at lists.llvm.org

With -Wsign-conversion, an & reduction on an integer value will emit a
diagnostic.  Here is a simple test case:

  int foo(int* v);

  int foo(int* v) {
    int r = ~0;

    #pragma omp simd reduction(&:r)
    for (int i = 0 ; i < 8 ; i++) {
      r &= v[i];
    }

    return r;
  }

When compiling:

  $ clang -Weverything -fopenmp-simd -c -o simd.o simd.c
  simd.c:6:32: warning: implicit conversion changes signedness: 'unsigned int'
to 'int' [-Wsign-conversion]
    #pragma omp simd reduction(&:r)
                               ^
  1 warning generated.

-- 
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/20200517/255f30a6/attachment.html>


More information about the llvm-bugs mailing list