[Bug target/101579] Suboptimal codegen for __builtin_shufflevector
crazylht at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Jul 28 10:12:07 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101579
--- Comment #8 from Hongtao.liu <crazylht at gmail dot com> ---
>
> U u = ((union { V a; U b; }) w).b + ((union { V a; U b; }) w).b[1];
> return u;
>
> I means the result u only cared about the first half, we can drop the second
> half, it's redundant.
Sorry for the typo, just want to clarify
result u = ((union { V a; U b; }) w).b + ((union { V a; U b; }) w).b[1]
where "(union { V a; U b; }) w).b" only cares about the first half, so does
"((union { V a; U b; }) w).b[1]" and "u", the second half of v is never used
and can be optimized away.
More information about the Gcc-bugs
mailing list