https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88473
--- Comment #2 from Daniel Fruzynski <bugzi...@poradnik-webmastera.com> --- I was playing with Compiler Explorer, to see how compilers optimize various pieces of code. I found that next clang version (currently trunk) will be able to analyze expressions which spans over vectors, masks and GPRs. I logged Bug 88476 to do something similar in gcc, please take a look. I think such approach as in clang would be more beneficial. In the past I also thought about template-based library, which would wrap vector operations. One of unique concepts was to create separate types to hold vector with bool values, and another one for int masks. With lazy instantiation this should lead to faster resulting code. I did not try to write it yet, but overall this approach look promising for me. With it such cases as in this bug can appear as a side effect of inlining.