Hi CFE-Devs,
I received a bug report for a breaking change between CLang v4.0 and v5.0 regarding sub-vectors that has been caused by:
http://llvm.org/viewvc/llvm-project?view=revision&revision=298369
The example is as follows:
char16 v0, v1;
…
v1.s0123456 = v0.s0123456; // Replace the 1st 7-elements of ‘v1’ with the 1st 7-elements of ‘v0’
which used to generate valid code, but which is now diagnosed with the following error:
error: vector component access has invalid length 7. Supported: 1,2,3,4,8,16.
However, I don’t see why it should not be possible to replace any range of elements of a vector with a corresponding set of elements. The “fix” in this case is to rewrite it as:
v1.lo = (char8){v0.s0, v0.s1, v0.s2, v0.s3,
v0.s4, v0.s5, v0.s6, v1.s7};
but this also generates slightly more code (on our platform) than the alternative rewrite:
v1 = (char16){v0.s0, v0.s1, v0.s2, v0.s3,
v0.s4, v0.s5, v0.s6, v1.s7,
v1.s8, v1.s9, v1.sa, v1.sb,
v1.sc, v1.sd, v1.se, v1.sf};
In either case, the rewrite seems unnecessarily verbose compared to the original form.
Thanks,
MartinO