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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
49 messages Options
123
Reply | Threaded
Open this post in threaded view
|

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

GHC - devs mailing list
#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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

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

GHC - devs mailing list
#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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

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

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

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

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

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

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

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

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

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

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

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

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

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

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

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

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

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

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

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

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

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

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

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

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

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

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

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

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

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

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

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

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

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

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

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

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
123