#1246: <= operators get compiled worse than ==
----------------------+-----------------------------------------------------
 Reporter:  duncan    |          Owner:         
     Type:  bug       |         Status:  new    
 Priority:  normal    |      Milestone:         
Component:  Compiler  |        Version:  6.6    
 Severity:  normal    |     Resolution:         
 Keywords:            |     Difficulty:  Unknown
 Testcase:            |   Architecture:  x86    
       Os:  Unknown   |  
----------------------+-----------------------------------------------------
Comment (by simonpj):

 Scary.  Are you suggesting that the compiler should
  * Unroll the loop one time (as you have done manually)
  * Spot that, once unrolled, the (n<=0) test can be replaced by (n==0)

 That looks pretty hard to achieve to me.  How would it know to unroll
 once?  Even once unrolled, spotting that you can relace n<=0 with n==0 is
 not trivial; for example it is only valid because the loop only subtracts
 one.

 Maybe you instead suggesting that the code generator do a better job of
 (<=).  That looks more feasible to me.

 Simon

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