[LLVMbugs] [Bug 6552] New: Assigning fp to a variable results in "Couldn't allocate output reg for constraint '{fp}'!"

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Mar 8 16:45:37 PST 2010


http://llvm.org/bugs/show_bug.cgi?id=6552

           Summary: Assigning fp to a variable results in "Couldn't
                    allocate output reg for constraint '{fp}'!"
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: ARM
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: john at bass-software.com
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=4433)
 --> (http://llvm.org/bugs/attachment.cgi?id=4433)
.ll file which results in a "Couldn't allocate output reg for constraint
'{fp}'!" error when compiled to object code.

Following C program compiled with llvm-gcc ("--target=arm-unknown-eabi
--with-arch=armv4"):

--8<--
extern void bar(unsigned int fp);

void foo(void)
{
  register unsigned int fp __asm ("fp");

  bar(fp);
}
--8<--

results in following .ll (in attachement as well):

--8<--
target datalayout =
"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-n32"
target triple = "armv4-unknown-eabi"

define arm_aapcscc void @foo() nounwind {
entry:
  %fp = alloca i32                                ; <i32*> [#uses=0]
  %"alloca point" = bitcast i32 0 to i32          ; <i32> [#uses=0]
  %0 = call i32 asm "", "={fp}"() nounwind        ; <i32> [#uses=1]
  call arm_aapcscc  void @bar(i32 %0) nounwind
  br label %return

return:                                           ; preds = %entry
  ret void
}
--8<--

which results in a "Couldn't allocate output reg for constraint '{fp}'!" error
when compiled to object code.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list