Segmentation fault on 'Combine redundant instructions'

The clBuildProgram function (driver #290.10) crashes into a Segmentation fault. The whole error message is the following:

Stack dump:

0.	Running pass 'Function Pass Manager' on module ''.

1.	Running pass 'Combine redundant instructions' on function '@Algo'

make: *** [output.raw] Segmentation fault

The openCL code leading to this failure is a code generated by an external tool building sometimes, depending on its options, some strange and inefficient but syntactically correct pieces of code.

The above failure comes from one of this pieces, exactly the following:

nm_Mask0 = nm_Lut_Dol_588 < 7 ? nm_Lut_Dol_588 : 7;

nm_Smooth_Dol = nm_Mask0 + nm_Mask0;

nm_Smooth_Mask1 = nm_Smooth_Dol + nm_Mask0;

nm_Smooth_Dol_0 = nm_Smooth_Mask1 + nm_Smooth_Mask1;

nm_Smooth_Dol_2 = nm_Smooth_Dol_0 + nm_Smooth_Mask1;

nm_Mask2 = (nm_Smooth_Dol_2 + (1 << (3-1))) >> 3;

nm_Smooth_Dol_7 = nm_Smooth_Mask1 * 3;

By simply moving up the last line, the compiler no longer crashes:

nm_Mask0 = nm_Lut_Dol_588 < 7 ? nm_Lut_Dol_588 : 7;

nm_Smooth_Dol = nm_Mask0 + nm_Mask0;

nm_Smooth_Mask1 = nm_Smooth_Dol + nm_Mask0;

nm_Smooth_Dol_0 = nm_Smooth_Mask1 + nm_Smooth_Mask1;

nm_Smooth_Dol_7 = nm_Smooth_Mask1 * 3;               // Moved line

nm_Smooth_Dol_2 = nm_Smooth_Dol_0 + nm_Smooth_Mask1;

nm_Mask2 = (nm_Smooth_Dol_2 + (1 << (3-1))) >> 3;

nm_Mask3 = (nm_Smooth_Dol_7 + (1 << (3-1))) >> 3;

So, what’s wrong ? Is this a known bug ?

Any help will be greatly appreciated

Thanks