While attempting to compile a C file generated by GHC. llvm-gcc chocked with the error message "sorry, unimplemented: LLVM cannot register variable 'R1'." and requested I report a bug. The GHC version was ghc-6.8.3. From the root of the GHC installation the path to the header llvm-gcc was parsing is "include/Regs.h" and the error occured at line 220. David
Please attach reproducible testcase
GHC probably depends on the GNU extension to pin global variables to physregs. This is not fully supported by llvm-gcc at this time. Please *do* include a testcase though.
Created attachment 1808 [details] haskell source and makefile to repeat issue llvm-gcc output does say the feature is not implemented. It also requests I submit a bug report which is why I have. I checked this out a little further today, and GHC does allow me to work around the register issue by defining 'NO_REGS'.
Forgot to mention. The makefile requires a variable. 'GHC_HOME=path/to/ghc-6.8.3/installation'
Created attachment 1809 [details] Preprocessed .c source Please next time include .c source, not haskell :)
This is basically: register StgUnion R1 __asm__("%" "esi"); where StgUnion is a big and scary thing. Putting a union in a register is vaguely wierd, but I can see why you'd want to do it. :)
This is also an issue if you try to build a 32-bit Linux kernel (ARCH=i386): /home/edwin/builds/linux-2.6/arch/x86/include/asm/thread_info.h:179:24: error: global register variables are not supported register unsigned long current_stack_pointer asm("esp") __used; ^
Edwin's example works for me with dragonegg. The preprocessed source for the original example is rejected by recent versions of gcc.