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

            Bug ID: 23719
           Summary: OpenCL: Crash with a vector initializer list with a
                    value that is a function call
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Created attachment 14411
  --> https://llvm.org/bugs/attachment.cgi?id=14411&action=edit
backtrace

// reproduce with:
// clang -DBUG test_vec_init.c -c -emit-llvm -o - -S

typedef float float2  __attribute__((__ext_vector_type__(2)));

float2 func(float2 a) { 
    return a;
} 

void test_vec_init() {
    volatile float2 a = (float2) ( 1.0f, 2.0f );
#ifndef BUG
    // This works.
    volatile float2 res = func(a);
    volatile float2 x = 
        (float2) (res.x, res.y);
#else
    // This crashes.
    volatile float2 x = 
        (float2) (func(a).x, a.x);
#endif
}


When compiled in C mode (without -x cl) it doesn't crash.

Backtrace attached.

-- 
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