[Bug target/81763] Issues with BMI on 32bit x86 apps on GCC 7.1+

ubizjak at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Jan 25 18:09:00 GMT 2018


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

--- Comment #23 from Uroš Bizjak <ubizjak at gmail dot com> ---
The above patch builds on the promise, that with (=r,r,r) alternative, the
register allocator won't allocate (=r1,=r2) = ~(r0,r1) & (r2,r3). This would
again clobber the r1 too early:

r1 = ~r0 & r2
r2 = ~r1 & r3

The safest choice of the pattern would be:

(define_insn "*andndi3_doubleword"
  [(set (match_operand:DI 0 "register_operand" "=r,&r")
        (and:DI
          (not:DI (match_operand:DI 1 "register_operand" "0,0"))
          (match_operand:DI 2 "nonimmediate_operand" "rm,rm")))
   (clobber (reg:CC FLAGS_REG))]
  "!TARGET_64BIT && TARGET_STV && TARGET_SSE2"
  "#"
  [(set_attr "isa" "bmi,*")])

(The earlyclobber of non-BMI case is needed due to separate not insn).


More information about the Gcc-bugs mailing list