https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98178

--- Comment #1 from Uroš Bizjak <ubizjak at gmail dot com> ---
The attached patch with the following testcase:

--cut here--
int test (int a, int b)
{
 return a << (b & 31);
}
--cut here--

fails to generate a single shift insn, because it does not trigger the call to
combine_split_insns. The reason is the following condition:

  /* If we were combining three insns and the result is a simple SET
     with no ASM_OPERANDS that wasn't recognized, try to split it into two
     insns.  There are two ways to do this.  It can be split using a
     machine-specific method (like when you have an addition of a large
     constant) or by combine in the function find_split_point.  */

  if (i1 && insn_code_number < 0 && GET_CODE (newpat) == SET
      && asm_noperands (newpat) < 0)

where i1 is null.

Please note, that omitting FLAGS_REG is intentional, c.f. PR96226#c2.

Reply via email to