http://llvm.org/bugs/show_bug.cgi?id=11311

             Bug #: 11311
           Summary: Range checking on builtins before template
                    instantiation
           Product: clang
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    Classification: Unclassified


Hi,

The following code doesn't compile:

#include <arm_neon.h>

template <int Ofs>
void test(float32x4_t& a, float32x4_t&b)
{
    a = vextq_f32(a,b,Ofs);
}

int main()
{
    float32x4_t a, b;
    test<1>(a, b);
}

Compilation fails with the following error:

bug.cpp:8:9: error: argument should be a value from 0 to 3
    a = vextq_f32(a,b,Ofs);
        ^~~~~~~~~~~~~~~~~~

Replacing Ofs -> 1 by hand resolves the error. Seems like clang performs range
checking even on templates that are not yet instantiated.

Apple clang version 3.0 (tags/Apple/clang-211.10.1) (based on LLVM 3.0svn)
Target: x86_64-apple-darwin10.8.0
Thread model: posix

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to