[GHC] #8195: Different floating point results with -msse2 on 32bit Linux

GHC ghc-devs at haskell.org
Thu Aug 29 15:49:53 UTC 2013


#8195: Different floating point results with -msse2 on 32bit Linux
------------------------------------------------+--------------------------
        Reporter:  jstolarek                    |            Owner:
            Type:  bug                          |           Status:  new
        Priority:  normal                       |        Milestone:
       Component:  Compiler (NCG)               |          Version:  7.7
      Resolution:                               |         Keywords:
Operating System:  Linux                        |     Architecture:  x86
 Type of failure:  None/Unknown                 |       Difficulty:
       Test Case:  perf/should_run/Conversions  |  Unknown
        Blocking:                               |       Blocked By:
                                                |  Related Tickets:
------------------------------------------------+--------------------------

Comment (by rwbarton):

 Yeah, the fact that `-msse2` affects the output is expected for the reason
 carter stated.  This issue is discussed generally at
 http://www.haskell.org/ghc/docs/latest/html/users_guide/bugs.html#bugs-ghc
 (last bullet point of 14.2.1).

 The reason your tail loop optimization affected the output is probably
 that with the optimization the code compiles to a loop in which `acc`
 lives in an 80-bit x87 register for the entire duration, while before the
 optimization `acc` was pushed on the stack as a 32-bit value for the
 recursive call.  (Or possibly it was spilled to memory for some other
 reason.)

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8195#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler




More information about the ghc-tickets mailing list