[GHC] #1861: Uncompilable code generated

View: New views
13 Messages — Rating Filter:   Alert me  

[GHC] #1861: Uncompilable code generated

by GHC-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#1861: Uncompilable code generated
----------------------+-----------------------------------------------------
 Reporter:  guest     |          Owner:      
     Type:  bug       |         Status:  new  
 Priority:  normal    |      Milestone:      
Component:  Compiler  |        Version:  6.8.1
 Severity:  normal    |       Keywords:      
 Testcase:            |   Architecture:  x86  
       Os:  MacOS X   |  
----------------------+-----------------------------------------------------
 When compiling via C the symbol Infinity is sometimes generated.
 {{{
 main = interact $ show . (< 1e400) . read
 }}}
 Compile with
 {{{
 ghc -O2 -fvia-C foo.hs
 }}}

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1861>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@...
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Re: [GHC] #1861: Uncompilable code generated

by GHC-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#1861: Uncompilable code generated
----------------------+-----------------------------------------------------
 Reporter:  guest     |          Owner:        
     Type:  bug       |         Status:  new    
 Priority:  normal    |      Milestone:  6.8.2  
Component:  Compiler  |        Version:  6.8.1  
 Severity:  normal    |     Resolution:        
 Keywords:            |     Difficulty:  Unknown
 Testcase:            |   Architecture:  x86    
       Os:  MacOS X   |  
----------------------+-----------------------------------------------------
Changes (by igloo):

  * difficulty:  => Unknown
  * milestone:  => 6.8.2

Comment:

 Thanks for the report.

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1861#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@...
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Re: [GHC] #1861: Uncompilable code generated

by GHC-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#1861: Uncompilable code generated
----------------------+-----------------------------------------------------
 Reporter:  guest     |          Owner:        
     Type:  bug       |         Status:  new    
 Priority:  normal    |      Milestone:  6.8.2  
Component:  Compiler  |        Version:  6.8.1  
 Severity:  normal    |     Resolution:        
 Keywords:            |     Difficulty:  Unknown
 Testcase:            |   Architecture:  x86    
       Os:  MacOS X   |  
----------------------+-----------------------------------------------------
Comment (by igloo):

 I can't reproduce this on amd64/Linux or x86/Linux. Can you please attach
 the output of running
 {{{
 ghc -O2 -fvia-C b.hs -tmpdir . -keep-tmp-files -v
 }}}
 as well as the temporary files (which should end up in a directory called
 something like `ghc16011_0/`?

 Thanks!

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1861#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@...
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Re: [GHC] #1861: Uncompilable code generated

by GHC-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#1861: Uncompilable code generated
----------------------+-----------------------------------------------------
 Reporter:  guest     |          Owner:        
     Type:  bug       |         Status:  new    
 Priority:  normal    |      Milestone:  6.8.3  
Component:  Compiler  |        Version:  6.8.1  
 Severity:  normal    |     Resolution:        
 Keywords:            |     Difficulty:  Unknown
 Testcase:            |   Architecture:  x86    
       Os:  MacOS X   |  
----------------------+-----------------------------------------------------
Changes (by igloo):

  * milestone:  6.8.2 => 6.8.3

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1861#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@...
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Re: [GHC] #1861: Uncompilable code generated

by GHC-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#1861: Uncompilable code generated
----------------------+-----------------------------------------------------
 Reporter:  guest     |          Owner:        
     Type:  bug       |         Status:  new    
 Priority:  lowest    |      Milestone:  6.8.3  
Component:  Compiler  |        Version:  6.8.1  
 Severity:  normal    |     Resolution:        
 Keywords:            |     Difficulty:  Unknown
 Testcase:            |   Architecture:  x86    
       Os:  MacOS X   |  
----------------------+-----------------------------------------------------
Changes (by igloo):

  * priority:  normal => lowest

Comment:

 (waiting for response)

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1861#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@...
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Re: [GHC] #1861: Uncompilable code generated

by GHC-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#1861: Uncompilable code generated
----------------------+-----------------------------------------------------
 Reporter:  guest     |          Owner:        
     Type:  bug       |         Status:  new    
 Priority:  lowest    |      Milestone:  6.8.3  
Component:  Compiler  |        Version:  6.9    
 Severity:  normal    |     Resolution:        
 Keywords:            |     Difficulty:  Unknown
 Testcase:            |   Architecture:  x86    
       Os:  MacOS X   |  
----------------------+-----------------------------------------------------
Changes (by guest):

  * version:  6.8.1 => 6.9

Comment:

 The GHC optimizations have regressed (I'll send a separate report) so the
 program has to be changed a little to generate uncompilable code:

 {{{
 main = interact $ show . (< (1e400 :: Double)) . read
 }}}

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1861#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@...
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Re: [GHC] #1861: Uncompilable code generated

by GHC-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#1861: Uncompilable code generated
----------------------+-----------------------------------------------------
 Reporter:  guest     |          Owner:        
     Type:  bug       |         Status:  new    
 Priority:  normal    |      Milestone:  6.8.3  
Component:  Compiler  |        Version:  6.9    
 Severity:  normal    |     Resolution:        
 Keywords:            |     Difficulty:  Unknown
 Testcase:            |   Architecture:  x86    
       Os:  MacOS X   |  
----------------------+-----------------------------------------------------
Changes (by igloo):

  * priority:  lowest => normal

Comment:

 OK, thanks, I can reproduce this now.

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1861#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@...
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Re: [GHC] #1861: Uncompilable code generated

by GHC-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#1861: Uncompilable code generated
----------------------+-----------------------------------------------------
 Reporter:  guest     |          Owner:        
     Type:  bug       |         Status:  new    
 Priority:  normal    |      Milestone:  6.8.3  
Component:  Compiler  |        Version:  6.9    
 Severity:  normal    |     Resolution:        
 Keywords:            |     Difficulty:  Unknown
 Testcase:            |   Architecture:  x86    
       Os:  MacOS X   |  
----------------------+-----------------------------------------------------
Comment (by simonpj):

 So the problem here is a narrow one: how does one write down the IEEE
 Double constant for infinity, in such a way that the C compiler
 understands it.  Does one write "1e400" or "1e10000000" (both are too big
 to be represented) or is there a kosher way to do it?

 Or can one say "0xblablah" where that's the IEEE bit pattern for infinity?
 Or perhaps "1/0" would do?  I don't know.

 Simon

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1861#comment:7>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@...
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Re: [GHC] #1861: Uncompilable code generated

by GHC-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#1861: Uncompilable code generated
----------------------+-----------------------------------------------------
 Reporter:  guest     |          Owner:        
     Type:  bug       |         Status:  new    
 Priority:  normal    |      Milestone:  6.8.3  
Component:  Compiler  |        Version:  6.9    
 Severity:  normal    |     Resolution:        
 Keywords:            |     Difficulty:  Unknown
 Testcase:            |   Architecture:  x86    
       Os:  MacOS X   |  
----------------------+-----------------------------------------------------
Comment (by simonmar):

 you can use the C constant `INFINITY`, which is defined by `math.h` (which
 we `#include` in generated C).

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1861#comment:8>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@...
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Re: [GHC] #1861: Uncompilable code generated

by GHC-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#1861: Uncompilable code generated
----------------------+-----------------------------------------------------
 Reporter:  guest     |          Owner:  simonmar
     Type:  bug       |         Status:  new    
 Priority:  normal    |      Milestone:  6.8.3  
Component:  Compiler  |        Version:  6.9    
 Severity:  normal    |     Resolution:          
 Keywords:            |     Difficulty:  Unknown
 Testcase:            |   Architecture:  x86    
       Os:  MacOS X   |  
----------------------+-----------------------------------------------------
Changes (by simonpj):

  * owner:  => simonmar

Comment:

 The problem is located at line 398 of `codeGen/PprC.hs`, which prints
 float/double constants in a form the C compiler understands.

 Two alternatives
  * Do what native code gen does: generate a hex constant and cast. Perhaps
 non-portable.

  * Do conditional tests to check for infinite values and `INFINITY`.  Also
 minus-infinite and NaN need checked.  In effect, this means moving the
 `fromRational` call in `Outputable.rational` into `PprC`.

 Simon M recommends the second for now.  And will do!

 Thanks

 Simon

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1861#comment:9>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@...
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Re: [GHC] #1861: Uncompilable code generated

by GHC-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#1861: Uncompilable code generated
----------------------+-----------------------------------------------------
 Reporter:  guest     |          Owner:  simonmar
     Type:  bug       |         Status:  new    
 Priority:  normal    |      Milestone:  6.8.3  
Component:  Compiler  |        Version:  6.9    
 Severity:  normal    |     Resolution:          
 Keywords:            |     Difficulty:  Unknown
 Testcase:            |   Architecture:  x86    
       Os:  MacOS X   |  
----------------------+-----------------------------------------------------
Comment (by simonmar):

 To merge:

 {{{
 Mon May 12 03:38:47 PDT 2008  Simon Marlow <marlowsd@...>
   * FIX #1861: floating-point constants for infinity and NaN in via-C
 }}}

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1861#comment:10>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@...
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Re: [GHC] #1861: Uncompilable code generated

by GHC-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#1861: Uncompilable code generated
----------------------+-----------------------------------------------------
 Reporter:  guest     |          Owner:  igloo  
     Type:  merge     |         Status:  new    
 Priority:  normal    |      Milestone:  6.8.3  
Component:  Compiler  |        Version:  6.9    
 Severity:  normal    |     Resolution:        
 Keywords:            |     Difficulty:  Unknown
 Testcase:            |   Architecture:  x86    
       Os:  MacOS X   |  
----------------------+-----------------------------------------------------
Changes (by simonmar):

  * owner:  simonmar => igloo
  * type:  bug => merge

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1861#comment:11>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@...
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Re: [GHC] #1861: Uncompilable code generated

by GHC-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#1861: Uncompilable code generated
----------------------+-----------------------------------------------------
 Reporter:  guest     |          Owner:  igloo  
     Type:  merge     |         Status:  closed
 Priority:  normal    |      Milestone:  6.8.3  
Component:  Compiler  |        Version:  6.9    
 Severity:  normal    |     Resolution:  fixed  
 Keywords:            |     Difficulty:  Unknown
 Testcase:            |   Architecture:  x86    
       Os:  MacOS X   |  
----------------------+-----------------------------------------------------
Changes (by igloo):

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

Comment:

 Merged

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1861#comment:12>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@...
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs