[LLVMbugs] [Bug 71] New: 'phi labels' in LLVM assembly, allowed or not?

bugzilla-daemon at zion.cs.uiuc.edu bugzilla-daemon at zion.cs.uiuc.edu
Wed Oct 29 14:33:03 PST 2003


http://llvm.cs.uiuc.edu/bugs/show_bug.cgi?id=71

           Summary: 'phi labels' in LLVM assembly, allowed or not?
           Product: tools
           Version: 1.0
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: minor
          Priority: P2
         Component: llvm-as
        AssignedTo: sabre at nondot.org
        ReportedBy: andrew.whitehead at utoronto.ca


I'm not actually sure whether the following code should compile or not (whether
it's valid LLVM assembly), but it certainly shouldn't produce the output it
currently does. I would expect the code to either run through the blocks
A->C->B->C->A->C->...  or for llvm-as to give a syntax error.

Input (test.ll):

int %main() {
A:
    br label %C
B:
    br label %C
C:
    %next = phi label [%B, %A], [%A, %B]
    br label %next
}

Output (llvm-as test.ll):

llvm-as: /home/andrew/misc/llvm/include/Support/Casting.h:194: typename
cast_retty<To, From>::ret_type cast(const Y&) [with X = BasicBlock, Y = Value*]:
Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
Aborted

Workaround (?):

int %main() {
A:
    br label %C
B:
    br label %C
C:
    %next = phi bool [false, %A], [true, %B]
    br bool %next, label %A, label %B
}



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.



More information about the llvm-bugs mailing list