[GHC] #14619: Output value of program changes upon compiling with -O optimizations

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Keywords: | Operating System: Windows Architecture: x86_64 | Type of failure: Incorrect result (amd64) | at runtime Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- The optimisation pass seems to affect the behaviour of the attached program (a basic ray-sphere intersection test, 40 lines long, no dependencies). Specifically, compiling the attached source file with -O or -O2, and considering the definition of main: {{{#!hs result = sphereIntersection testRay testSphere main :: IO() main = do print $ result print $ sphereIntersection testRay testSphere }}} I get the troubling output: {{{
bug.exe Just ((0.0,0.0,0.0),0.0) Just ((0.0,0.0,100.0),1.0) }}}
This is especially troubling because the second component of the output should always be 1.0: {{{#!hs testRay = ((0, 0, 0),(0, 0, 1)) sphereIntersection (orig, dir@(_, _, dirz)) (c,r) | disc < 0 = Nothing | t1 > 0 = Just (t1 *> dir <+> orig, dirz) | t2 > 0 = Just (t2 *> dir <+> orig, dirz) | otherwise = Nothing where ... }}} as we are returning the "dirz" component of the input ray straight back out. On the other hand, when the program is run without optimisations, I get the expected output: {{{
bug.exe Just ((0.0,0.0,100.0),1.0) Just ((0.0,0.0,100.0),1.0) }}}
This behaviour was present on all versions of GHC that I tested (7.10.1, 8.0.1, 8.2.1, 8.2.2). I initially ran into this issue when I noticed that the profiling builds of my program produced different results, which was boiled down to this problem. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by sheaf): * Attachment "bug.hs" added. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by Phyx-): * os: Windows => Unknown/Multiple Comment: Thanks for the report!, reclassifying so it gets more eyeballs. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by mpickering): What exact invocation of GHC are you using to reproduce this? I can't with
`ghc bug.hs` and `ghc -O2 bug.hs`
-- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: infoneeded Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by mpickering): * status: new => infoneeded -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: infoneeded Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by sheaf): I'm not doing anything specific at all, just plain vs -O2 as you seem to be doing. {{{
ghc bug.hs [1 of 1] Compiling Main ( bug.hs, bug.o ) Linking bug.exe ...
bug Just ((0.0,0.0,100.0),1.0) Just ((0.0,0.0,100.0),1.0)
ghc bug.hs -O2 -fforce-recomp [1 of 1] Compiling Main ( bug.hs, bug.o ) Linking bug.exe ...
bug Just ((0.0,0.0,0.0),0.0) Just ((0.0,0.0,100.0),1.0) }}}
-- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by mpickering): * status: infoneeded => new * os: Unknown/Multiple => Windows Comment: Phyx said that he could reproduce something wrong using his windows server. Can you provide some details about your machine? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by sheaf): Sure thing. I'm running Windows 7 64-bit, on an Intel i7-3820 CPU. Let me know what other information would be helpful. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Phyx-): Guess it is Windows specific... {{{ Tamar@Rage ~/g/l/p/t/T3994.run> ghc "bug.hs" -O2 -fforce-recomp; ./bug.exe [1 of 1] Compiling Main ( bug.hs, bug.o ) Linking bug.exe ... Just ((0.0,0.0,0.0),0.0) Just ((0.0,0.0,100.0),1.0) }}} {{{ Tamar@Rage ~/g/l/p/t/T3994.run> ghc "bug.hs" -O2 -fforce-recomp -fno- worker-wrapper; ./bug.exe [1 of 1] Compiling Main ( bug.hs, bug.o ) Linking bug.exe ... Just ((0.0,0.0,100.0),1.0) Just ((0.0,0.0,100.0),1.0) }}} {{{ Tamar@Rage ~/g/l/p/t/T3994.run> ~/ghc2/inplace/bin/ghc-stage2.exe "bug.hs" -O2 -fforce-recomp; ./bug.exe [1 of 1] Compiling Main ( bug.hs, bug.o ) Linking bug.exe ... Just ((0.0,0.0,100.0),1.0) Just ((0.0,0.0,100.0),1.0) }}} So it seems to work on HEAD also, but the 8.0.2 fails.. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): I am curious as to why it's failing on earlier GHC versions. Here's a slightly modified version of the program that also prints different output depending on the optimization level: {{{#!hs module Main (main) where import Debug.Trace type V3 = (Double, Double, Double) infixl 6 <-> infixl 7 <.> (<->) :: V3 -> V3 -> V3 (<->) (x, y, z) (x', y', z') = (x-x', y-y', z-z') (<.>) :: V3 -> V3 -> Double (<.>) (x, y, z) (x', y', z') = x*x'+y*y'+z*z' sphereIntersection :: V3 -> V3 -> V3 sphereIntersection orig dir | t1 > 0 = traceShow ("orig", orig) $ traceShow ("dir", dir) $ -- traceShow ("oc", oc) $ traceShow ("b", b) $ traceShow ("disc", disc) $ traceShow ("sqrtDisc", sqrtDisc) $ traceShow ("t1", t1) $ dir where oc = (0, 0, 200) <-> orig b = oc <.> dir disc = 50000 - oc <.> oc sqrtDisc = sqrt disc t1 = b - sqrtDisc {-# NOINLINE sphereIntersection #-} main :: IO () main = print $ sphereIntersection (0, 0, 0) (0, 0, 1) }}} {{{ $ ghc -O0 Foo.hs -fforce-recomp [1 of 1] Compiling Main ( Foo.hs, Foo.o ) Linking Foo.exe ... $ ./Foo.exe ("orig",(0.0,0.0,0.0)) ("dir",(0.0,0.0,1.0)) ("b",200.0) ("disc",10000.0) ("sqrtDisc",100.0) ("t1",100.0) (0.0,0.0,1.0) $ ghc -O1 Foo.hs -fforce-recomp [1 of 1] Compiling Main ( Foo.hs, Foo.o ) Linking Foo.exe ... $ ./Foo.exe ("orig",(0.0,0.0,0.0)) ("dir",(0.0,0.0,0.0)) ("b",200.0) ("disc",10000.0) ("sqrtDisc",100.0) ("t1",100.0) (0.0,0.0,0.0) }}} Notice that in the optimized version, GHC thinks the `dir` argument is `(0.0,0.0,0.0)`, when it should be `(0.0,0.0,1.0)`! To make things stranger, if you uncomment the `traceShow ("oc", oc) $` line, then the optimized program's answer is different (but still wrong): {{{ $ ghc -O1 Foo.hs -fforce-recomp [1 of 1] Compiling Main ( Foo.hs, Foo.o ) Linking Foo.exe ... $ ./Foo.exe ("orig",(0.0,0.0,0.0)) ("dir",(0.0,0.0,40000.0)) ("oc",(0.0,0.0,200.0)) ("b",200.0) ("disc",10000.0) ("sqrtDisc",100.0) ("t1",100.0) (0.0,0.0,40000.0) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by dfeuer): * cc: dfeuer (added) * priority: normal => high * milestone: => 8.6.1 Comment: Raising priority. Not raising it to highest for now because it looks like it could be some fragile floating-point business. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by mpickering): It seems to have been lost above but -fno-worker-wrapper fixes the issue. This seems to point to the implementation of unboxed tuples or Double# being the issue. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by carter): Which windows architecture is this on? What’s the abi afoot / registers involved ? Aka what’s the assembly for that module ? Does the answer change if the sphere calc is marked noinline? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Phyx-): It's x64, I haven't had the time to look at this yet. Marking it inline does indeed fix it. I'll attach the two disassembly. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by Phyx-): * Attachment "Bug.s" added. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by Phyx-): * Attachment "Bug-working.s" added. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): Other flags that cause the issue to disappear: * `-fllvm` * `-fno-cmm-sink` -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by carter): * priority: high => highest * milestone: 8.6.1 => 8.4.1 Comment: Slyfox on irc was suggesting this is some sort of bug in caller/callee save convention on the 64bit windows mingw path. That disabling the cmm sink pass or using llvm backend resolve this issue is evidence that some register allocation related error only on that platform. Since this is a tier 1 platform And this seems to be a case of silently incorrect programs on a tier 1 platform , I’m marking this as highest priority. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by carter): To further clarify: it’s not something about floating point per se, but a bug related to optimizations after register allocation -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by dfeuer): That's fine, Carter. I didn't want a subtle platform-specific numerical stability issue to hold up the release; if it's more than that, I agree it's highest priority. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:16 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by carter): Agreed. :) It’s not a stability or rounding issue. ESP since disabling cmm sink pass makes the issue go away as per Ryan’s testing I’ll try to look more later this evening -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:17 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by Phyx-): * Attachment "Bug-no.dump-cmm" added. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by Phyx-): * Attachment "Bug-ok.dump-cmm" added. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by Phyx-): * cc: Phyx- (added) Comment: I've attached two cmm files one that work and one that doesn't. My initial thought is register pressure, but the working version seems to have higher pressure. Looking at the working one, I see only two differences, 1) it uses 8 bytes more of stack space for each function call 2) it does a lot of redundant moves. {{{ movq 24(%rbx),%rbx movq %rbx,%rcx movq %rcx,-24(%rbp) }}} instead of simply {{{ movq 24(%rbx),%rax movq %rax,-24(%rbp) }}} but aside from these two I can't seem to find any real differences. There's also slightly different scheduling. Can scheduling be turned off in GHC? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:18 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by Phyx-): * Attachment "Bug-head-nog.dump-cmm" added. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by Phyx-): * Attachment "Bug-8.2.2-nog.dump-cmm" added. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Phyx-): I'm starting to think this isn't a GHC bug. I've attached two dumps created with the current `HEAD` and `8.2.2`. Because the representation of `show` for `Float` seems to have changed I'm avoiding using it. My repro is {{{ module Main where import Prelude hiding((*>), (<*)) type V3 = (Double, Double, Double) infixl 6 <+> infixl 7 <.> infix 8 *> (<+>) :: V3 -> V3 -> V3 (<+>) (x, y, z) (x', y', z') = (x+x', y+y', z+z') (*>) :: Double -> V3 -> V3 (*>) a (x', y', z') = (a*x', a*y', a*z') (<.>) :: V3 -> V3 -> Double (<.>) (x, y, z) (x', y', z') = x*x'+y*y'+z*z' sphereIntersection :: V3 -> V3 -> V3 -> Maybe (V3, Double) sphereIntersection orig dir@(_, _, dirz) c | b < 0 = Nothing | t1 > 0 = Just (t1 *> dir, dirz) | t2 > 0 = Just (t2 *> orig, dirz) | otherwise = Nothing where oc = c <+> orig b = oc <.> dir sqrtDisc = sqrt b t1 = b - sqrtDisc t2 = b + sqrtDisc result = sphereIntersection (0, 0, 0) (0, 0, 1) (0, 0, 200) main :: IO (Maybe (V3, Double)) main = return result }}} Both are compiled with `-fforce-recomp -O2 -ddump-cmm -ddump-to-file` and there is no meaningful difference in code gen. only label names. The only remaining difference is in toolchain. 8.4.1 has an upgraded toolchain (and so head) vs 8.2.2. So this is looking like an upstream issue. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:19 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Phyx-): However, using the newer toolchain with the same Haskell libraries as before (e.g. base, GHC-prim) etc generates the same wrong result. So It's unlikely to be a `mingw-w64` bug. Back to GHC it is.. but likely now should look at the code in base. I also swapped out GHC-prim from 8.2.2 with the one from head and that didn't work. So the difference must be in base? I'm grasping at straws here :) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:20 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Phyx-): I'll make some time to look at it this weekend. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:21 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by lelf): * cc: lelf (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:22 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by carter): summary notes of findings / information so far. 1) reproducible in 64bit windows/ mingw32 windows 64bit build. Phyx- indicated that the bug is observable with ghc 8.2 and old, but not with 8.4/head? 2) O2 and disabling the CMM SINK optimization pass makes the bug go away, which seems to indicate / hint at the issue being some piece of compilation / optimization that interacts with the CMM Sink algorithm using platform dependent data is incorrect theres not that many places (seemingly) where the information / action differs at this layer between different x86_64 compiler targets. So i think one of the spots in cmm/ native code gen that does something different when the platform in MinGW32 is the culptrit? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:23 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by carter): also phyx- had mentioned that when looking at the generate code, the bug seems to boil down to an xmm6 register being saved but not restored? one crazy experiment i'm wondering about is if using the graph register allocator would have the same bug? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:24 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations
-------------------------------------+-------------------------------------
Reporter: sheaf | Owner: (none)
Type: bug | Status: new
Priority: highest | Milestone: 8.4.1
Component: Compiler | Version: 8.2.2
Resolution: | Keywords:
Operating System: Windows | Architecture: x86_64
Type of failure: Incorrect result | (amd64)
at runtime | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Phyx-):
I don't think it's a register allocation issue. I think it's a genuine bug
in a Core2Core pass:
Following the code fom `sphereIntersection`, the first interesting
location is
`0x0000000000401E72` (it's all statically linked). At this address the
first 6 doubles are loaded from the
stack:
{{{
0x401e72

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj):
I think it's a Core pass eliminating a value it shouldn't.
That would be easier to fix; but wouldn't that affect all platforms equally? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:26 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Phyx-):
That would be easier to fix; but wouldn't that affect all platforms equally?
Yes, but I'm honestly still a bit puzzled as to what makes this failure Windows only. While on Windows `xmm6` is a callee save register we seem to be handling that correctly. Also the sequence has no branches in between. Only jumps so it shouldn't matter. It's also very fragile. Small alterations to the test program trying to reduce makes the issue go away. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:27 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by carter): 1) phyx- none of these register excerpts mention xmm0 .... whys that? the set of caller saved registers is xmm0 -xmm5 ... but here the exceprts only work on xmm1-xmm6! (is there some off by one error in the register abi encoding stuff ?) 2) i think we can probably assume / presume that the code at fault likely lies somewhere in https://github.com/ghc/ghc/blob/ghc-8.2/compiler/nativeGen/X86/CodeGen.hs#L2... (perma link https://github.com/ghc/ghc/blob/4d99a665986f66f403ad49f7d91a1fc069870274/com... ) or something related in register/abi stuff -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:28 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by carter): i'm also curious if the bug can be reproduced with `-fregs-graph ` -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:29 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Phyx-): {{{ Tamar@Rage ~/ghc2> /r/ghc-8.2.2/bin/ghc.exe -O2 -fforce-recomp -fregs- graph Bug.hs -o Bug-reg.exe; ./Bug-reg.exe [1 of 1] Compiling Main ( Bug.hs, Bug.o ) Linking Bug-reg.exe ... Just ((575.5051025721682,1151.0102051443364,0.0),0.0) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:30 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by AndreasK): I shrank the repo case a bit: {{{ module Main where import Prelude hiding((*>), (<*)) type V3 = (Double, Double, Double) (<+>) :: V3 -> V3 -> V3 (<+>) (_, _, z) (_, _, z') = (0,0, z+z') (<.>) :: V3 -> V3 -> Double (<.>) (x, y, z) (x', y', z') = x*x' +y*y'+z*z' {-# NOINLINE sphereIntersection #-} sphereIntersection :: V3 -> V3 -> Maybe (V3, Double) sphereIntersection orig dir@(_, _, dirz) | b < 0 = Nothing | t1 > 0 = Just (dir, dirz) | t1 < 0 = Just (orig, dirz) | otherwise = Nothing where b = orig <.> dir sqrtDisc = sqrt b t1 = b - sqrtDisc main = print . fmap fst $ sphereIntersection (0, 0, 200) (0, 0, 1) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:31 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by AndreasK):
I think it's a Core pass eliminating a value it shouldn't.
The STG dumps are exactly the same so we can rule that out for better or worse. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:32 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by AndreasK): I think the sinking pass is fine, the code below fails: {{{ c3Yz: // global _s3Wg::F64 = %MO_F_Add_W64(%MO_F_Add_W64(%MO_F_Mul_W64(D1, D4), %MO_F_Mul_W64(D2, D5)), %MO_F_Mul_W64(D3, D6)); if (%MO_F_Lt_W64(_s3Wg::F64, 0.0 :: W64)) goto c3Zq; else goto c3Zp; c3Zp: // global _s3We::F64 = D5; _s3Wd::F64 = D4; _s3Wc::F64 = D3; _s3Wb::F64 = D2; _s3Wa::F64 = D1; (_c3YT::F64) = call MO_F64_Sqrt(_s3Wg::F64); _s3Wn::F64 = %MO_F_Sub_W64(_s3Wg::F64, _c3YT::F64); if (%MO_F_Gt_W64(_s3Wn::F64, 0.0 :: W64)) goto c3Zn; else goto c3Zi; c3Zn: // global I64[Hp - 40] = GHC.Types.D#_con_info; F64[Hp - 32] = D6; I64[Hp - 24] = GHC.Types.D#_con_info; F64[Hp - 16] = _s3We::F64; I64[Hp - 8] = GHC.Types.D#_con_info; F64[Hp] = _s3Wd::F64; R3 = Hp - 39; R2 = Hp - 23; R1 = Hp - 7; call (P64[Sp])(R3, R2, R1) args: 8, res: 0, upd: 8; ... }}} If we respect the calling convention and MO_F_Add/Mul don't clobber their arguments the code would be fine. I guess the liveness analysis when assigning registers thinks sqrt clobbers D6/xmm6 anyway so it's free to use it as a scratch register before that. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:33 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by AndreasK): GHC-8.2 does mess up the register allocation/calling convention on the foreign call to sqrt. {{{ call sqrt # born: %r3 ... %r29 %r30 %r31 ... # w_dying: %r0 ... %r29 %r31 ... }}} The bad news is that there is a good chance that it only works on head because we use the sqrt assembly instruction instead which sidesteps the issue. {{{ ... sqrtsd %vSSE_s3Lt,%vSSE_c3O1 # born: %vSSE_c3O1 ... }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:34 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by AndreasK): When checking for invalidated registers we use callClobberedRegs. However this is the definition for Windows: {{{ | platformOS platform == OSMinGW32 = [rax,rcx,rdx,r8,r9,r10,r11] ++ map regSingle (floatregnos platform) }}} Which just lists ALL floating point registers. Instead we should use the information provided in CodeGen.Platform to check if they are callee-saved or not and let good things happen. I will put a patch up in the next few days. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:35 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: AndreasK Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.2.2 (CodeGen) | Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by AndreasK): * owner: (none) => AndreasK * component: Compiler => Compiler (CodeGen) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:36 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: AndreasK Type: bug | Status: patch Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.2.2 (CodeGen) | Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4348 Wiki Page: | -------------------------------------+------------------------------------- Changes (by AndreasK): * status: new => patch * differential: => Phab:D4348 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:37 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: AndreasK Type: bug | Status: patch Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.2.2 (CodeGen) | Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4348 Wiki Page: | -------------------------------------+------------------------------------- Comment (by carter): @ben: this is a pretty important bug fix for windows: let’s make sure it makes it into 8.4! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:38 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations
-------------------------------------+-------------------------------------
Reporter: sheaf | Owner: AndreasK
Type: bug | Status: patch
Priority: highest | Milestone: 8.4.1
Component: Compiler | Version: 8.2.2
(CodeGen) |
Resolution: | Keywords:
Operating System: Windows | Architecture: x86_64
Type of failure: Incorrect result | (amd64)
at runtime | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D4348
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: AndreasK Type: bug | Status: closed Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.2.2 (CodeGen) | Resolution: fixed | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4348 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed Comment: Merged with fe485f2961324d3b798d4dc8b1ccd27e887fa213. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:40 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14619: Output value of program changes upon compiling with -O optimizations -------------------------------------+------------------------------------- Reporter: sheaf | Owner: AndreasK Type: bug | Status: closed Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.2.2 (CodeGen) | Resolution: fixed | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: T14619 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4348 Wiki Page: | -------------------------------------+------------------------------------- Changes (by dfeuer): * testcase: => T14619 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14619#comment:41 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC