#1605: hppa port -- gmp handed misaligned memory
----------------------------+-----------------------------------------------
 Reporter:  guest           |          Owner:             
     Type:  bug             |         Status:  new        
 Priority:  normal          |      Milestone:  6.8.3      
Component:  Runtime System  |        Version:  6.6.1      
 Severity:  normal          |     Resolution:             
 Keywords:  GMP             |     Difficulty:  Easy (1 hr)
 Testcase:                  |   Architecture:  hppa       
       Os:  HPUX            |  
----------------------------+-----------------------------------------------
Comment (by igloo):

 I think that something like this might be the way to go:
 {{{
 diff -rN -u old-val/rts/PrimOps.cmm new-val/rts/PrimOps.cmm
 --- old-val/rts/PrimOps.cmm     2008-05-24 02:20:52.000000000 +0100
 +++ new-val/rts/PrimOps.cmm     2008-05-24 02:21:06.000000000 +0100
 @@ -546,23 +546,33 @@

  /* ToDo: this is shockingly inefficient */

 +#if defined(hpux_HOST_OS)
 +#define MP_ALIGN align 8;
 +#else
 +#define MP_ALIGN
 +#endif
 +
  #ifndef THREADED_RTS
  section "bss" {
 +  MP_ALIGN
    mp_tmp1:
      bits8 [SIZEOF_MP_INT];
  }

  section "bss" {
 +  MP_ALIGN
    mp_tmp2:
      bits8 [SIZEOF_MP_INT];
  }

  section "bss" {
 +  MP_ALIGN
    mp_result1:
      bits8 [SIZEOF_MP_INT];
  }

  section "bss" {
 +  MP_ALIGN
    mp_result2:
      bits8 [SIZEOF_MP_INT];
  }
 @@ -691,6 +701,7 @@

  #ifndef THREADED_RTS
  section "bss" {
 +  MP_ALIGN
    mp_tmp_w:  W_; // NB. mp_tmp_w is really an here mp_limb_t
  }
  #endif
 }}}
 but (in the HEAD) having the align on amd64/Linux gives me:
 {{{
 ../compiler/ghc-inplace -Werror -H64m -Onot -fasm -optc-O2 -I../includes
 -I. -Iparallel -Ism -DCOMPILING_RTS -package-name rts -fvia-C -static
 -I../gmp/gmpbuild -I../libffi/build/include -I. -dcmm-lint     -c
 PrimOps.cmm -o PrimOps.o
 ghc-6.9.20080523: panic! (the 'impossible' happened)
   (GHC version 6.9.20080523 for x86_64-unknown-linux):
         PprC.pprTop: can't handle this data

 Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

 make[1]: *** [PrimOps.o] Error 1
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1605#comment:3>
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