#1852: -O2 -funbox-strict-fields causes incorrect behavior
----------------------+-----------------------------------------------------
 Reporter:  mwolak    |          Owner:  simonmar      
     Type:  bug       |         Status:  new           
 Priority:  high      |      Milestone:  6.8.2         
Component:  Compiler  |        Version:  6.8.1         
 Severity:  normal    |     Resolution:                
 Keywords:            |     Difficulty:  Unknown       
 Testcase:            |   Architecture:  x86_64 (amd64)
       Os:  Linux     |  
----------------------+-----------------------------------------------------
Changes (by simonpj):

  * priority:  normal => high
  * difficulty:  => Unknown
  * owner:  => simonmar
  * milestone:  => 6.8.2

Comment:

 More information: this bug happens
  * on a 64-bit machine
  * only with `-fasm` not `-fvia-C`

 I'm pretty certain it's a bug in the layout of static data constructors.
 Here is the assembly code for the static closure for `(Vec 1.0 2.0 3.0
 4.0)` (at least I think so).  Notice that we're only allocating 4 bytes
 per (unboxed) float, whereas we should be allocating 8.  Over to you,
 Simon.
 {{{
 rQP_closure:
         .quad   Main_Vec4_static_info
         .byte   0
         .byte   0
         .byte   128
         .byte   63
         .byte   0
         .byte   0
         .byte   0
         .byte   64
         .byte   0
         .byte   0
         .byte   64
         .byte   64
         .byte   0
         .byte   0
         .byte   128
         .byte   64
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1852#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to