#7192: Bug in -fregs-graph with -fnew-codegen
---------------------------------+------------------------------------------
    Reporter:  simonmar          |       Owner:  benl            
        Type:  bug               |      Status:  new             
    Priority:  highest           |   Milestone:  7.8.1           
   Component:  Compiler          |     Version:  7.7             
    Keywords:                    |          Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown    
  Difficulty:  Unknown           |    Testcase:                  
   Blockedby:                    |    Blocking:  4258            
     Related:                    |  
---------------------------------+------------------------------------------

Comment(by benl):

 @simonmar: yes. It looks like the NCG (or something) is broken
 independently from the graph allocator.

 When compiling with -fllvm I get the right answer:

 {{{
 desire:diophantine benl$ pwd
 /Users/benl/devel/ghc/ghc-head-devel/testsuite/tests/dph/diophantine

 desire:diophantine benl$ /Users/benl/devel/ghc/ghc-head-devel/inplace/bin
 /ghc-stage2 --version
 The Glorious Glasgow Haskell Compilation System, version 7.7.20121112

 desire:diophantine benl$ /Users/benl/devel/ghc/ghc-head-devel/inplace/bin
 /ghc-stage2 \
   -fforce-recomp -dcore-lint -dcmm-lint \
   --make -o dph-diophantine-copy-fast Main \
   -O -fno-enable-rewrite-rules -package dph-lifted-copy -fllvm

 desire:diophantine benl$ ./dph-diophantine-copy-fast
 (1260,[2,2,1,1,0])
 (1260,[2,2,1,1,0])
 (1260,fromList<PArray> [2,2,1,1,0])
 }}}

 But with with NCG `-fno-regs-graph` it gives a different answer:
 {{{
 desire:diophantine benl$ /Users/benl/devel/ghc/ghc-head-devel/inplace/bin
 /ghc-stage2 \
   -fforce-recomp -dcore-lint -dcmm-lint \
   --make -o dph-diophantine-copy-fast Main \
   -O -fno-enable-rewrite-rules -package dph-lifted-copy -fno-regs-graph

 desire:diophantine benl$ ./dph-diophantine-copy-fast
 dph-diophantine-copy-fast: Prelude.minimum: empty list
 }}}

 Compiling in different ways by typing `make` in that same directory
 sometimes causes a stack overflow instead of `Prelude.minimum: empty list`

 I looked through the output assembly code but didn't find code code
 sequence in your initial report. My approach was to compile with `-ddump-
 cmmz-sp -ddump-to-file` then grep

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