[Bug target/58945] Improve atomic_compare_and_swap*_doubleword pattern

ubizjak at gmail dot com gcc-bugzilla@gcc.gnu.org
Fri Oct 17 07:33:00 GMT 2014


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

--- Comment #6 from Uroš Bizjak <ubizjak at gmail dot com> ---
Hm, starting from:

                (unspec_volatile:TI [
                        (mem/v:TI (symbol_ref:DI ("i")  <var_decl
0x2adae9631c60 i>) [-1  S16 A128])
                        (reg:TI 85)
                        (reg:DI 97)
                        (reg:DI 98 [+8 ])
                        (const_int 5 [0x5])


fwprop creates:

                (unspec_volatile:TI [
                        (mem/v:TI (symbol_ref:DI ("i")  <var_decl
0x2adae9631c60 i>) [-1  S16 A128])
                        (reg:TI 86)
                        (reg:DI 97)
                        (reg:DI 97)
                        (const_int 5 [0x5])

Register allocators can't allocate reg 97 to "b" and "c" constraint:

        (unspec_volatile:<DWI>
          [(match_operand:<DWI> 1 "memory_operand" "+m")
           (match_operand:<DWI> 2 "register_operand" "0")
           (match_operand:DWIH 3 "register_operand" "b")
           (match_operand:DWIH 4 "register_operand" "c")
           (match_operand:SI 5 "const_int_operand")]
          UNSPECV_CMPXCHG))

So, a fwprop bug?


More information about the Gcc-bugs mailing list