[LLVMbugs] [Bug 1763] New: llc: Couldn't allocate output reg for contraint 'q'!

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sat Nov 3 15:18:32 PDT 2007


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

           Summary: llc: Couldn't allocate output reg for contraint 'q'!
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: edwintorok at gmail.com
                CC: llvmbugs at cs.uiuc.edu


kernel/sched.c gives an error in code generator:

$ llvm-gcc testcase-min.i
Couldn't allocate output reg for contraint 'q'!
$ llc bugpoint-reduced-simplified.bc
Couldn't allocate output reg for contraint 'q'!

testcase-min.i:
static inline __attribute__((always_inline)) struct task_struct
*get_current(void) {
     }
       static inline __attribute__((always_inline)) unsigned long
__xchg(unsigned long x, volatile void * ptr, int size) {
      switch (size) {
      case 1:    __asm__ __volatile__("xchgb %b0,%1"     :"=q" (x)     :"m"
(*((volatile long *)(ptr))), "0" (x)     :"memory");
     }
     }
       struct task_struct {
      volatile long state;
     };
       void __attribute__((__section__(".sched.text"))) yield(void) {
      do {
    (void) ((__typeof__(*(&get_current()->state)))__xchg((unsigned
long)((0)),(&get_current()->state),sizeof(*(&get_current()->state))));
    }
     while (0);
     }

bugpoint_reduced_simplified.ll:
; ModuleID = 'bugpoint-reduced-simplified.bc'
target datalayout =
"e-p:64:64:64-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-s0:64:64-f80:128:128"
target triple = "x86_64-unknown-linux-gnu"

define void @yield() {
entry:
        br i1 false, label %bb, label %return

bb:             ; preds = %entry
        %tmp9 = call i64 asm sideeffect "xchgb ${0:b},$1",
"=q,*m,0,~{dirflag},~{fpsr},~{flags},~{memory}"( i64* null, i64 0 )   ; <i64>
[#uses=0]
        ret void

return:         ; preds = %entry
        ret void
}


$ llc --version
Low Level Virtual Machine (http://llvm.org/):
  llvm version 2.2svn
  DEBUG build with assertions.
$ uname -a
Linux lightspeed2 2.6.23-rc8-hrt1-cfs-v22-g1bef7dc0-dirty #17 Sun Sep 30
18:49:34 EEST 2007 x86_64 GNU/Linux


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