
Hi, I did some modifications to GHC in order to read hardware counters. Many programs are compiled successfully, but with one of them, I have a problem: Too many local registers allocated by gcc at .../ghc-6.6.1-modified/driver/mangler/ghc-asm line 1602, <INASM> line 304643. It's ghc 6.6.1 on an Itanium processor. Some suggestion? Thanks in advance for an answer. Cristian

On Wed, 2007-10-31 at 14:40 +0100, Cristian Perfumo wrote:
Hi, I did some modifications to GHC in order to read hardware counters. Many programs are compiled successfully, but with one of them, I have a problem:
Too many local registers allocated by gcc at .../ghc- 6.6.1-modified/driver/mangler/ghc-asm line 1602, <INASM> line 304643.
It's ghc 6.6.1 on an Itanium processor.
I never found a satisfactory answer. On IA64 we just hope that ghc generates C code that does not turn into object code that uses too many variables. We tried playing with gcc flags to make it only use the limited number of registers but could not make it work. The only workarounds I know of are to use less aggressive optimisation, both in ghc and gcc, so try with -optc-O rather than -optc-O2 and try -O0 rather than -O. Duncan

We are working on a substantial re-engineering of GHC's code generation, so this problem will eventually go away. But think "2008" not "Christmas 2007". Meanwhile does -fasm work? Simon | -----Original Message----- | From: glasgow-haskell-users-bounces@haskell.org [mailto:glasgow-haskell-users-bounces@haskell.org] On Behalf Of | Duncan Coutts | Sent: 31 October 2007 23:37 | To: Cristian Perfumo | Cc: glasgow-haskell-users@haskell.org | Subject: Re: Too many local registers... | | On Wed, 2007-10-31 at 14:40 +0100, Cristian Perfumo wrote: | > Hi, | > I did some modifications to GHC in order to read hardware counters. | > Many programs are compiled successfully, but with one of them, I have | > a problem: | > | > Too many local registers allocated by gcc at .../ghc- | > 6.6.1-modified/driver/mangler/ghc-asm line 1602, <INASM> line 304643. | > | > It's ghc 6.6.1 on an Itanium processor. | | I never found a satisfactory answer. On IA64 we just hope that ghc | generates C code that does not turn into object code that uses too many | variables. We tried playing with gcc flags to make it only use the | limited number of registers but could not make it work. The only | workarounds I know of are to use less aggressive optimisation, both in | ghc and gcc, so try with -optc-O rather than -optc-O2 and try -O0 rather | than -O. | | Duncan | _______________________________________________ | Glasgow-haskell-users mailing list | Glasgow-haskell-users@haskell.org | http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Simon Peyton-Jones wrote:
We are working on a substantial re-engineering of GHC's code generation, so this problem will eventually go away. But think "2008" not "Christmas 2007". Meanwhile does -fasm work?
There's no NCG for IA64, unfortunately. Unless someone writes one before 6.10, IA64 will be relegated to unregisterised compilation. Cheers, Simon
Simon
| -----Original Message----- | From: glasgow-haskell-users-bounces@haskell.org [mailto:glasgow-haskell-users-bounces@haskell.org] On Behalf Of | Duncan Coutts | Sent: 31 October 2007 23:37 | To: Cristian Perfumo | Cc: glasgow-haskell-users@haskell.org | Subject: Re: Too many local registers... | | On Wed, 2007-10-31 at 14:40 +0100, Cristian Perfumo wrote: | > Hi, | > I did some modifications to GHC in order to read hardware counters. | > Many programs are compiled successfully, but with one of them, I have | > a problem: | > | > Too many local registers allocated by gcc at .../ghc- | > 6.6.1-modified/driver/mangler/ghc-asm line 1602, <INASM> line 304643. | > | > It's ghc 6.6.1 on an Itanium processor. | | I never found a satisfactory answer. On IA64 we just hope that ghc | generates C code that does not turn into object code that uses too many | variables. We tried playing with gcc flags to make it only use the | limited number of registers but could not make it work. The only | workarounds I know of are to use less aggressive optimisation, both in | ghc and gcc, so try with -optc-O rather than -optc-O2 and try -O0 rather | than -O. | | Duncan | _______________________________________________ | Glasgow-haskell-users mailing list | Glasgow-haskell-users@haskell.org | http://www.haskell.org/mailman/listinfo/glasgow-haskell-users _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

| I never found a satisfactory answer. On IA64 we just hope that ghc | generates C code that does not turn into object code that uses too many | variables. We tried playing with gcc flags to make it only use the | limited number of registers but could not make it work. The only | workarounds I know of are to use less aggressive optimisation, both in | ghc and gcc, so try with -optc-O rather than -optc-O2 and try -O0 rather | than -O. | | Duncan
Thank you all for the answers, specially to Duncan... -optc-O did the trick :) Best Cristian
participants (4)
-
Cristian Perfumo
-
Duncan Coutts
-
Simon Marlow
-
Simon Peyton-Jones