#7383: implement proper type promotion in compilation of C calls
---------------------------------+------------------------------------------
    Reporter:  igloo             |       Owner:                  
        Type:  bug               |      Status:  new             
    Priority:  high              |   Milestone:  7.8.1           
   Component:  Compiler          |     Version:  7.6.1           
    Keywords:                    |          Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown    
  Difficulty:  Unknown           |    Testcase:                  
   Blockedby:                    |    Blocking:                  
     Related:                    |  
---------------------------------+------------------------------------------
 {{{
 > commit 229323898b0809047b19b79c181085430cce9850
 > Author: Ian Lynagh <i...@well-typed.com>
 > Date:   Thu Nov 1 14:13:05 2012 +0000
 >
 >      Fix popcnt calls
 >
 >      We don't want to narrow the argument size before making the foreign
 >      call: Word8 still gets passed as a Word-sized argument

 I'm not sure this is right (I added the narrowing, FWIW).  The fact that
 Word8 gets promoted to Word is part of the C ABI, and we don't want to
 do that when popcnt is being implemented directly by the native codegen.
   I know it is currently broken on some platforms, but I think the fix
 is to implement the proper type promotion in the compilation of C calls.
 }}}

 A useful test for this is cgrun071. If we get it wrong then it fails on
 x86, as the stack alignment is wrong when calling e.g. `popCnt8#`.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7383>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to