https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117950
Bug ID: 117950 Summary: vector extraction view convert not detected Product: gcc Version: 15.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: pinskia at gcc dot gnu.org Target Milestone: --- Take: ``` typedef __attribute((vector_size(4))) unsigned char v4uc; int f(v4uc a) { return a[0]|(a[1]<<8)|(a[2]<<16)|(a[3]<<24); } v4uc g(int num) { v4uc a={num & 0xff, (num >> 8) & 0xff, (num >> 16) & 0xff, (num >> 24) & 0xff}; return a; } ``` GCC bswap is able to optimize g just VIEW_CONVERT_EXPR but it does not handle f.