https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84431
Uroš Bizjak <ubizjak at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2018-02-20 Assignee|unassigned at gcc dot gnu.org |ubizjak at gmail dot com Ever confirmed|0 |1 --- Comment #3 from Uroš Bizjak <ubizjak at gmail dot com> --- Created attachment 43471 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43471&action=edit Prototype patch Prototype patch, compiles the testcase to: movl 4(%esp), %eax movl 12(%esp), %ecx movl 8(%esp), %edx shldl %eax, %edx sall %cl, %eax ret The patch also handles right shifts and cases where mask is less than 31 bits.