Opened 11 years ago

Closed 11 years ago

Last modified 45 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: Test Case:
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description

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 
PPC):
  $ 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 
  $ 

Environment:
  ghc 6.2.1
  Mac OS X
  PPC 

Attachments (1)

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

Download all attachments as: .zip

Change History (2)

Changed 11 years ago by mtullsen

comment:1 Changed 11 years ago by wthaller

  • Status changed from assigned to closed
Logged In: YES 
user_id=566359

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 
this.
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.