Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

global register variables not supported #2894

Closed
llvmbot opened this issue Jul 7, 2008 · 9 comments
Closed

global register variables not supported #2894

llvmbot opened this issue Jul 7, 2008 · 9 comments
Labels
bugzilla Issues migrated from bugzilla llvm-tools All llvm tools that do not have corresponding tag worksforme Resolved as "works for me"

Comments

@llvmbot
Copy link
Member

llvmbot commented Jul 7, 2008

Bugzilla Link 2522
Resolution WORKSFORME
Resolved on May 04, 2012 06:41
Version 2.3
OS Windows XP
Blocks llvm/llvm-bugzilla-archive#4068
Reporter LLVM Bugzilla Contributor
CC @asl,@edwintorok

Extended Description

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

@asl
Copy link
Collaborator

asl commented Jul 7, 2008

Please attach reproducible testcase

@lattner
Copy link
Collaborator

lattner commented Jul 7, 2008

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.

@llvmbot
Copy link
Member Author

llvmbot commented Jul 8, 2008

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

@llvmbot
Copy link
Member Author

llvmbot commented Jul 8, 2008

Forgot to mention. The makefile requires a variable.

'GHC_HOME=path/to/ghc-6.8.3/installation'

@asl
Copy link
Collaborator

asl commented Jul 8, 2008

Preprocessed .c source
Please next time include .c source, not haskell :)

@lattner
Copy link
Collaborator

lattner commented Jul 10, 2008

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. :)

@edwintorok
Copy link
Contributor

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;
^

@llvmbot
Copy link
Member Author

llvmbot commented May 4, 2012

Edwin's example works for me with dragonegg. The preprocessed source for the
original example is rejected by recent versions of gcc.

@edwintorok
Copy link
Contributor

mentioned in issue llvm/llvm-bugzilla-archive#4068

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
@Quuxplusone Quuxplusone added the worksforme Resolved as "works for me" label Jan 20, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla llvm-tools All llvm tools that do not have corresponding tag worksforme Resolved as "works for me"
Projects
None yet
Development

No branches or pull requests

5 participants