This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

v8.0.0b4 crashes on conversion from int scalar to floating-point vector

The subject line says it all really.  My very first test with the new OpenCL vector support was a simple summation loop:

float4 sum( unsigned count, float4 const data[] )
{
	float4 sum = 0;

	#pragma MUST_ITERATE( 1 )
	for( unsigned i = 0; i < count; i++ )
		sum += data[i];

	return sum;
}

which resulted in

>>>> Optimizer terminated abnormally
>>>>    in function _Z3sumjPKU11__cl_vector4_f()
>>>>    in file "test.cc"

>> Compilation failure

Similar result for other floating-point vector types, but integer types worked.  I'm targeting c674x but I also tried compiling for c6600, same result.

The problem turned out to be the initializer, using one of these instead solves the problem:

	float4 sum = (float4)( 0, 0, 0, 0 );
	float4 sum = (float) 0;
	float4 sum = 0.;
  • When reporting a problem, please be sure to include a complete test case, including any needed #include directives and command-line options.  This is a new feature I'm not familiar with, so I had to go digging around to find the right stuff.  I've reproduced this problem with the following test case, and have submitted SDSCM00051088 to track the issue.

    % cat CQ51088.c
    #include "c6x_vec.h"
    float4 sum() { return 0; }
    % cl6x CQ51088.c  --vectypes --c99 -mv6600
    [Optimizer terminated abnormally]
  • Wow, in retrospect my post exhibits just about every rookie mistake a bug report can have... incomplete source, missing build options, test case not minimized, and irrelevant narrative.  I'm not sure how that happened, but I'll certainly pay more attention before hitting "Post" next time.  Apologies!

  • No worries; the fact that you gave a reproducible test case was the important part, and much appreciated.