https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85730
--- Comment #9 from Uroš Bizjak <ubizjak at gmail dot com> --- An interesting observation with the following testcase: --cut here-- typedef char V __attribute__((vector_size(4))); struct S { char val; char pad1; char pad2; char pad3; }; V foo (V v) { v[0] <<= 3; return v; } struct S bar (struct S a) { a.val <<= 3; return a; } --cut here-- gcc -O2: foo: movsbl %dil, %edx movl %edi, %eax sall $3, %edx movb %dl, %al ret bar: movl %edi, %eax salb $3, %al ret So, the compiler is able to produce optimal code with equivalent struct description, but something (in middle-end?) prevents the same optimization with a vector (a.k.a array).