Quantcast

[GHC] #5965: pref-llvm error: stored value and pointer type do not match

classic Classic list List threaded Threaded
11 messages Options
GHC
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[GHC] #5965: pref-llvm error: stored value and pointer type do not match

GHC
#5965: pref-llvm error: stored value and pointer type do not match
---------------------------------+------------------------------------------
 Reporter:  Favonia              |          Owner:  dterei        
     Type:  bug                  |         Status:  new            
 Priority:  normal               |      Component:  Compiler (LLVM)
  Version:  7.5                  |       Keywords:                
       Os:  Linux                |   Architecture:  x86_64 (amd64)
  Failure:  Building GHC failed  |       Testcase:                
Blockedby:                       |       Blocking:                
  Related:                       |  
---------------------------------+------------------------------------------
 The GHC in the trunk (revision [bcb599506764d551e0e6b9084e0e9580f3f00336])
 does not build in the final stage with "pref-llvm":

 {{{
 "inplace/bin/ghc-stage1" -fPIC -dynamic  -O -H64m -fllvm
     -package-name integer-gmp-0.3.0.0 -hide-all-packages
     (...snipped...)
     -package-name integer-gmp -XHaskell98 -XCPP -XMagicHash
     -XUnboxedTuples -XNoImplicitPrelude -XForeignFunctionInterface
     -XUnliftedFFITypes -O2  -no-user-package-conf -rtsopts
     -c libraries/integer-gmp/cbits/gmp-wrappers.cmm
     -o libraries/integer-gmp/dist-install/build/cbits/gmp-wrappers.dyn_o
 /usr/bin/opt: /tmp/ghc2438_0/ghc2438_0.ll:3766:9: error: stored value and
 pointer type do not match
   store i32 %ln1fM, i64* %lc1dk
         ^
 }}}

 Here is the output of configure:

 {{{
 Configure completed successfully.

    Building GHC version  : 7.5.20120324

    Build platform        : x86_64-unknown-linux
    Host platform         : x86_64-unknown-linux
    Target platform       : x86_64-unknown-linux

    Bootstrapping using   : /usr/bin/ghc
       which is version   : 7.4.1

    Using GCC                 : /usr/bin/gcc
       which is version       : 4.6.3
    Building a cross compiler : NO
    Porting to foreign arch   : NO
    Alien script              :
 }}}

 While it is clear to me that the offending LLVM line is wrong, sorry that
 I do not know how to trace back to the source of the problem. If providing
 any other information will help, please let me know.

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

_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
GHC
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [GHC] #5965: pref-llvm failed at integer-gmp-0.3.0.0: stored value and pointer type do not match (was: pref-llvm error: stored value and pointer type do not match)

GHC
#5965: pref-llvm failed at integer-gmp-0.3.0.0: stored value and pointer type do
not match
---------------------------------+------------------------------------------
 Reporter:  Favonia              |          Owner:  dterei        
     Type:  bug                  |         Status:  new            
 Priority:  normal               |      Component:  Compiler (LLVM)
  Version:  7.5                  |       Keywords:                
       Os:  Linux                |   Architecture:  x86_64 (amd64)
  Failure:  Building GHC failed  |       Testcase:                
Blockedby:                       |       Blocking:                
  Related:                       |  
---------------------------------+------------------------------------------

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

_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
GHC
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [GHC] #5965: pref-llvm failed at integer-gmp-0.3.0.0: stored value and pointer type do not match

GHC
In reply to this post by GHC
#5965: pref-llvm failed at integer-gmp-0.3.0.0: stored value and pointer type do
not match
-------------------------------+--------------------------------------------
    Reporter:  Favonia         |        Owner:  dterei            
        Type:  bug             |       Status:  closed            
    Priority:  normal          |    Component:  Compiler (LLVM)    
     Version:  7.5             |   Resolution:  fixed              
    Keywords:                  |           Os:  Linux              
Architecture:  x86_64 (amd64)  |      Failure:  Building GHC failed
    Testcase:                  |    Blockedby:                    
    Blocking:                  |      Related:                    
-------------------------------+--------------------------------------------
Changes (by dterei):

  * status:  new => closed
  * resolution:  => fixed


Comment:

 OK recent win64 fixes by Ian did this, specifically:
 216150a6dc2c59a5ade398cad849a0c093572d12

 He truncates an Long (64bit) to an Int (32bit) and stores it back in a
 Long. As this is in Cmm which plugs directly into the backends you can't
 have automatic type conversion like this with LLVM (NCG doesn't care).
 I've changed the storage type to be an Int as well, see commit:
 121cd52f9ae00ff0d6d072cc51939fb887db3fba

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

_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
GHC
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [GHC] #5965: pref-llvm failed at integer-gmp-0.3.0.0: stored value and pointer type do not match

GHC
In reply to this post by GHC
#5965: pref-llvm failed at integer-gmp-0.3.0.0: stored value and pointer type do
not match
----------------------------------+-----------------------------------------
  Reporter:  Favonia              |          Owner:                
      Type:  bug                  |         Status:  new          
  Priority:  highest              |      Milestone:  7.6.1        
 Component:  libraries (other)    |        Version:  7.5          
Resolution:                       |       Keywords:                
        Os:  Linux                |   Architecture:  x86_64 (amd64)
   Failure:  Building GHC failed  |     Difficulty:  Unknown      
  Testcase:                       |      Blockedby:                
  Blocking:                       |        Related:                
----------------------------------+-----------------------------------------
Changes (by igloo):

  * status:  closed => new
  * component:  Compiler (LLVM) => libraries (other)
  * priority:  normal => highest
  * difficulty:  => Unknown
  * milestone:  => 7.6.1
  * owner:  dterei =>
  * resolution:  fixed =>


Comment:

 Oh, sorry, I probably meant to fix that better later and then forgot.

 I'm not sure the fix is right, though: The GMP function is presumably
 expecting a long, not an int.

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

_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
GHC
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [GHC] #5965: pref-llvm failed at integer-gmp-0.3.0.0: stored value and pointer type do not match

GHC
In reply to this post by GHC
#5965: pref-llvm failed at integer-gmp-0.3.0.0: stored value and pointer type do
not match
----------------------------------+-----------------------------------------
  Reporter:  Favonia              |          Owner:                
      Type:  bug                  |         Status:  new          
  Priority:  highest              |      Milestone:  7.6.1        
 Component:  libraries (other)    |        Version:  7.5          
Resolution:                       |       Keywords:                
        Os:  Linux                |   Architecture:  x86_64 (amd64)
   Failure:  Building GHC failed  |     Difficulty:  Unknown      
  Testcase:                       |      Blockedby:                
  Blocking:                       |        Related:                
----------------------------------+-----------------------------------------

Comment(by dterei):

 hmmm I wasn't sure here either, the docs for the GMP function specify some
 strange type for the function def.

 If it is expecting a long I guess we should apply two casts to keep the
 physical storage the same but truncate it to 32bit representation.

 From [http://gmplib.org/manual/Integer-Arithmetic.html#Integer-Arithmetic
 GMP Docs]:

 {{{
 Function: void mpz_mul_2exp (mpz_t rop, mpz_t op1, mp_bitcnt_t op2)
 }}}

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

_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
GHC
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [GHC] #5965: pref-llvm failed at integer-gmp-0.3.0.0: stored value and pointer type do not match

GHC
In reply to this post by GHC
#5965: pref-llvm failed at integer-gmp-0.3.0.0: stored value and pointer type do
not match
----------------------------------+-----------------------------------------
  Reporter:  Favonia              |          Owner:                
      Type:  bug                  |         Status:  new          
  Priority:  highest              |      Milestone:  7.6.1        
 Component:  libraries (other)    |        Version:  7.5          
Resolution:                       |       Keywords:                
        Os:  Linux                |   Architecture:  x86_64 (amd64)
   Failure:  Building GHC failed  |     Difficulty:  Unknown      
  Testcase:                       |      Blockedby:                
  Blocking:                       |        Related:                
----------------------------------+-----------------------------------------

Comment(by dterei):

 OK also from GMP Docs:

 {{{
 Counts of bits of a multi-precision number are represented in the C type
 mp_bitcnt_t. Currently this is always an unsigned long, but on some
 systems it will be an unsigned long long in the future.
 }}}

 So I guess we should apply two casts. The other option is to add code to
 the LLVM backend to handle doing implicit coercions making it compatible
 with NCG as bugs of this nature come up every few months. However I'd like
 to avoid that as its only the hand written cmm code that it can occur in
 so for now dealing with these on a case by case basis seems OK.

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

_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
GHC
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [GHC] #5965: pref-llvm failed at integer-gmp-0.3.0.0: stored value and pointer type do not match

GHC
In reply to this post by GHC
#5965: pref-llvm failed at integer-gmp-0.3.0.0: stored value and pointer type do
not match
----------------------------------+-----------------------------------------
  Reporter:  Favonia              |          Owner:                
      Type:  bug                  |         Status:  new          
  Priority:  highest              |      Milestone:  7.6.1        
 Component:  libraries (other)    |        Version:  7.5          
Resolution:                       |       Keywords:                
        Os:  Linux                |   Architecture:  x86_64 (amd64)
   Failure:  Building GHC failed  |     Difficulty:  Unknown      
  Testcase:                       |      Blockedby:                
  Blocking:                       |        Related:                
----------------------------------+-----------------------------------------

Comment(by dterei):

 Igloo should I handle this or will you handle?

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

_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
GHC
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [GHC] #5965: pref-llvm failed at integer-gmp-0.3.0.0: stored value and pointer type do not match

GHC
In reply to this post by GHC
#5965: pref-llvm failed at integer-gmp-0.3.0.0: stored value and pointer type do
not match
----------------------------------+-----------------------------------------
  Reporter:  Favonia              |          Owner:                
      Type:  bug                  |         Status:  closed        
  Priority:  highest              |      Milestone:  7.6.1        
 Component:  libraries (other)    |        Version:  7.5          
Resolution:  fixed                |       Keywords:                
        Os:  Linux                |   Architecture:  x86_64 (amd64)
   Failure:  Building GHC failed  |     Difficulty:  Unknown      
  Testcase:                       |      Blockedby:                
  Blocking:                       |        Related:                
----------------------------------+-----------------------------------------
Changes (by favonia):

  * status:  new => closed
  * resolution:  => fixed


Comment:

 I am the reporter and GHC was successfully built with dterei's fix.
 Thanks!

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

_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
GHC
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [GHC] #5965: pref-llvm failed at integer-gmp-0.3.0.0: stored value and pointer type do not match

GHC
In reply to this post by GHC
#5965: pref-llvm failed at integer-gmp-0.3.0.0: stored value and pointer type do
not match
----------------------------------+-----------------------------------------
  Reporter:  Favonia              |          Owner:                
      Type:  bug                  |         Status:  new          
  Priority:  highest              |      Milestone:  7.6.1        
 Component:  libraries (other)    |        Version:  7.5          
Resolution:                       |       Keywords:                
        Os:  Linux                |   Architecture:  x86_64 (amd64)
   Failure:  Building GHC failed  |     Difficulty:  Unknown      
  Testcase:                       |      Blockedby:                
  Blocking:                       |        Related:                
----------------------------------+-----------------------------------------
Changes (by igloo):

  * status:  closed => new
  * resolution:  fixed =>


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

_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
GHC
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [GHC] #5965: pref-llvm failed at integer-gmp-0.3.0.0: stored value and pointer type do not match

GHC
In reply to this post by GHC
#5965: pref-llvm failed at integer-gmp-0.3.0.0: stored value and pointer type do
not match
----------------------------------+-----------------------------------------
  Reporter:  Favonia              |          Owner:  igloo        
      Type:  bug                  |         Status:  new          
  Priority:  highest              |      Milestone:  7.6.1        
 Component:  libraries (other)    |        Version:  7.5          
Resolution:                       |       Keywords:                
        Os:  Linux                |   Architecture:  x86_64 (amd64)
   Failure:  Building GHC failed  |     Difficulty:  Unknown      
  Testcase:                       |      Blockedby:                
  Blocking:                       |        Related:                
----------------------------------+-----------------------------------------
Changes (by igloo):

  * owner:  => igloo


Comment:

 I'll look at it.

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

_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
GHC
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [GHC] #5965: pref-llvm failed at integer-gmp-0.3.0.0: stored value and pointer type do not match

GHC
In reply to this post by GHC
#5965: pref-llvm failed at integer-gmp-0.3.0.0: stored value and pointer type do
not match
----------------------------------+-----------------------------------------
  Reporter:  Favonia              |          Owner:  igloo        
      Type:  bug                  |         Status:  closed        
  Priority:  highest              |      Milestone:  7.6.1        
 Component:  libraries (other)    |        Version:  7.5          
Resolution:  fixed                |       Keywords:                
        Os:  Linux                |   Architecture:  x86_64 (amd64)
   Failure:  Building GHC failed  |     Difficulty:  Unknown      
  Testcase:                       |      Blockedby:                
  Blocking:                       |        Related:                
----------------------------------+-----------------------------------------
Changes (by igloo):

  * status:  new => closed
  * resolution:  => fixed


Comment:

 Fixed by:
 {{{
 commit 5dfb7d3ca63790dd4b5947b2abc30cfa8b7c5a57
 Author: Ian Lynagh <[hidden email]>
 Date:   Wed Jun 20 14:28:36 2012 +0100

     Use CLong, not CInt, for mp_bitcnt_t value; fixes #5965
 }}}

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

_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Loading...