[llvm-bugs] [Bug 25557] New: clang accepts implicit conversion between vector types

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Nov 17 10:48:44 PST 2015


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

            Bug ID: 25557
           Summary: clang accepts implicit conversion between vector types
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: philip.pfaffe at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Clang silently accepts implicit conversions between vector types.

Minimal example:

// clang++ -std=c++11 -mavx2
#include <cstdint>
#include <immintrin.h>

int main() {
  uint8_t C[8] = {1,2,3,4,5,6,7,8};

  __m256i V = _mm256_loadu_si256((__m256i*)C);
  __m256i Two =  _mm256_set1_epi32(2);
  __m256 R = _mm256_div_ps(V, Two);
}

V and Two are here implicitly converted from __m256i to __m256. Both are
typedefs of float and longlong vectors, respectively. 
I think clang should at least throw a warning here (which is what icc does) or,
even better, an error (the gcc behaviour).

-- 
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/20151117/14628045/attachment.html>


More information about the llvm-bugs mailing list