
#9346: AtomicPrimOps tests failing on 32-bit x86 -------------------------------------+------------------------------------- Reporter: niklasl | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.9 Resolution: | Keywords: Differential Revisions: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: Difficulty: Unknown | Blocking: Blocked By: | Related Tickets: | -------------------------------------+------------------------------------- Comment (by niklasl): Seems like the lock gets separated from the compxchg somewhere in the register allocation. I don't know why it's treated as a separate instruction, I can't think of a case where you wouldn't want it glued to the parent instruction. And the move looks bogus too, ecx and that stack slot already contains the same stuff. {{{ ==================== Native code ==================== movl %vI_c2eB,%vI_n2tm movl %vI_c2eA,%vI_n2tn movl %vI_n2tn,%eax lock cmpxchgl %vI_n2tm,(%vI_n2tl) movl %eax,%vI_s1Rr movl %vI_s1Rr,%vI_s1Ru jmp _c2eD }}} {{{ ==================== Liveness annotations added ==================== movl %vI_c2ez,%vI_n2tl # born: %vI_n2tl # r_dying: %vI_c2ez movl %vI_c2eB,%vI_n2tm # born: %vI_n2tm # r_dying: %vI_c2eB movl %vI_c2eA,%vI_n2tn # born: %vI_n2tn # r_dying: %vI_c2eA movl %vI_n2tn,%eax # born: %r0 # r_dying: %vI_n2tn lock cmpxchgl %vI_n2tm,(%vI_n2tl) # r_dying: %vI_n2tl %vI_n2tm movl %eax,%vI_s1Rr # born: %vI_s1Rr # r_dying: %r0 movl %vI_s1Rr,%vI_s1Ru # born: %vI_s1Ru # r_dying: %vI_s1Rr jmp _c2eD # r_dying: %vI_s1Ru }}} {{{ ==================== Registers allocated ==================== movl 88(%esp),%ecx movl %eax,100(%esp) movl %ecx,%eax lock movl 100(%esp),%ecx cmpxchgl %ecx,(%edx) jmp _c2eD }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9346#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler