So I've been writhing my OpenCL project until I run into a strange problem: a call to clBuildProgram results in a segmentation fault.
I'm providing a sample code here (see attached archive) that gives a SIGSEGV every single time you try to build it.
In advance: please don't try to understand what this code does, as the sample is not meaningful. It's a cut-down kernel of a meaningful program, with just enough code left to crash the compiler. The goal here is only to demonstrate the bug.
If that matters, I tested under Windows 7 and using OCL SDK Light.
Hope this gets fixed ASAP!
Adding a very useful piece of information.
Replacing line 59 of main.cpp from my archive with
ret = clBuildProgram(program, 1, &device_id, "-cl-std=CL2.0 -cl-opt-disable", NULL, NULL);
makes the example compile.
That essentially means that the optimization logic in the compiler is flawed.
I've also found two interesting details: