-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Error in backend: Ran out of registers during register allocation! #6681
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
Comments
I don't have a super-recent build of clang; I'll build one. With my build about a week old I'm not getting the same error, perhaps for environmental reasons or perhaps because somebody improved this message recently IIRC, but I do get: fatal error: error in backend: Invalid operand found in inline asm: 'push %ebp
This comes from asm volatile llvm doesn't know what $Return means, nor do I. fwiw, this file doesn't come close to going through llvm-g++. I'm not a C++ language expert but I suspect clang is accepting some stuff it shouldn't be. |
C++ ? this is a portion of c code. |
Oh. It is even farther away from going through llvm-gcc; there are hundreds of errors. |
I can't reproduce; can you try again with trunk? |
I can still reproduce it. Tested with : clang version 1.5 (trunk 101072) Target: i686-pc-mingw32 |
Still exists. Tested with : |
I can't reproduce this. Please attach a bitcode file. |
I could reproduce it with clang version 2.0 (trunk 103176) |
I can reproduce this, from testcase3.c, on x86_86-linux-unknown-gnu. Passing -m32 gives me the assert 'i != PhysRegsUseOrder.size() && "Couldn't find a register of the appropriate class!', while the default (64 bit) gives me: /tmp/cc-WxevLz.s: Assembler messages: on i386-apple-darwin10 I get: fatal error: error in backend: Invalid operand found in inline asm: 'push %ebp
I notice that the lines which are complained about are exactly those inserted via the inline asm. |
RegAllocLocal.cpp is no longer, and the bitcode passes through llc -O0 without problems. |
clang version 2.0 (trunk 106854) fatal error: error in backend: Ran out of registers during register allocation!
|
clang -emit-llvm -S gives : ; ModuleID = 'testcase4.c' %struct.__SEH2Frame = type {} define void @_SEH2FrameHandler() nounwind { declare x86_stdcallcc void @RtlUnwind(...) !0 = metadata !{i32 215} |
The LLVM code generator does not fully support the polymorphic "g" constraint. It is basically treated as an "r" constraint. Your inline asm does not leave enough registers available for all the "g" constraints. Please choose which argument should be a memory reference, and use an "m" constraint for that one instead. |
The fact that GCC does accept such code means a bug in clang ? or in gcc ? or ? |
The GCC inline asm syntax provides direct hooks into the guts of GCC. |
Actually "g" is supposed to be reducing to "m" in doubtful cases. The choice is made before there is any info about register availability, so this may produce inferior code to gcc, but should work. With Jakob's help I was finally able to reproduce this and I'm looking at it. |
Should be fixed in 106893. |
mentioned in issue llvm/llvm-bugzilla-archive#6815 |
Extended Description
clang version 1.1 (trunk 95495)
Target: i686-pc-mingw32
Thread model: posix
I've attached the preprocessed file.
The text was updated successfully, but these errors were encountered: