https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106069
--- Comment #32 from Xionghu Luo (luoxhu at gcc dot gnu.org) <yinyuefengyi at gmail dot com> --- Thanks for all the information! It inspires to me that "native RTL should be endian-independent". So both big-endian and little-endian platform should generate same (vec_select (vec_concat (R0 R1) [0 4 1 5])) for altivec_vmrghw, then combine pass could do correct "nested vec_select" optimization, the endian check are left to ASM generation at last, that's the benefit for removing the UNSPECS. My culprit patch did change the LE representation, sorry for the stupid mistake... Attached the fix patch. If it is reasonable, I will continue refine it and send to maillist.