Merging r195367:
------------------------------------------------------------------------
r195367 | joey | 2013-11-21 09:09:05 -0800 (Thu, 21 Nov 2013) | 17 lines

Fix a crash in EmitStoreThroughExtVectorComponentLValue for vectors of odd sizes.

In OpenCL a vector of 3 elements, acts like a vector of four elements.
So for a vector of size 3 the '.hi' and '.odd' accessors, would access
the elements {2, 3} and {1, 3} respectively.
However, in EmitStoreThroughExtVectorComponentLValue we are still operating on
a vector of size 3, so we should only access {2} and {1}. We do this by checking
the last element to be accessed, and ignore it if it is out-of-bounds.

EmitLoadOfExtVectorElementLValue doesn't have a similar problem, because it does
a direct shufflevector with undef, so an out-of-bounds access just gives an undef
value.

Patch by Anastasia Stulova!



------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@195386 91177308-0d34-0410-b5e6-96231b3b80d8
2 files changed