Opened 13 years ago

Closed 13 years ago

Last modified 48 years ago

#257 closed bug (Wont Fix)

power-pc code generation error

Reported by: mtullsen Owned by: wthaller
Priority: normal Milestone:
Component: Compiler (NCG) Version: 6.2.1
Keywords: Cc:
Operating System: Architecture:
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


The following code (in Test.hs, attached):
  module Test where 
  data T = C1
            | C2
            | C200
results in an assembler error when compiling natively (for the 
  $ ghc -c Test.hs 
  /tmp/ghc8899.s:6652:Fixup of 45900 too large for field width of 
16 bits
  /tmp/ghc8899.s:6650:Fixup of 45908 too large for field width of 
16 bits

I don't have a problem when I compile via C:
  $ ghc -fvia-C -c Test.hs 

  ghc 6.2.1
  Mac OS X

Attachments (1)

Test.2.hs (2.9 KB) - added by mtullsen 13 years ago.

Download all attachments as: .zip

Change History (2)

Changed 13 years ago by mtullsen

Attachment: Test.2.hs added

comment:1 Changed 13 years ago by wthaller

Status: assignedclosed
Logged In: YES 

Thanks for the report. 
Yes, I know that this can happen. Your large datatype results in more 
than 32K of code being generated, which the PowerPC's conditional 
branches can't handle. GHC currently doesn't do anything to work around 
GHC 6.4 will feature a completely rewritten backend, which, while not 
really fixing this issue, will make it much less likely to happen in 
practice. Therefore, I am closing this bug as "Won't Fix".
For now, I recommend that you just add {-# OPTIONS -fvia-C #-} to the 
top of your source file; after GHC 6.4 is released, you'll be able to 
remove this.
Note: See TracTickets for help on using tickets.