http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59835
--- Comment #7 from Uroš Bizjak <ubizjak at gmail dot com> --- (In reply to Jakub Jelinek from comment #5) > Of course, no real performance testing has been performed, perhaps there > should be one ? or more for the =Q, Q, 0 alternative. Without any ?, we > don't ICE or endlessly consume memory anymore, with one ? we do again. IMO, handling of mask registers can be improved overall. However, we have to start somewhere, and for 4.9 the implementation is "good enough" to move things forward. On the condition that nothing regresses, of course. The perfection will be reached incrementally in later revisions. Your patch is in the right direction, but probably requires various cost function improvements and some fine tuning of constraints. I believe that compiler should be able to choose correct instructions on its own, without crippling the move pattern with UNSPEC.