[LLVMbugs] [Bug 1258] NEW: type planes not collapsed for unnamed variables

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sun Mar 18 07:52:28 PDT 2007


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

           Summary: type planes not collapsed for unnamed variables
           Product: libraries
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core LLVM classes
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: nicholas at mxc.ca


The following program assembles with llvm-as:

  define i32 @test1(i32 %a, i32 %b) {
  entry:
          icmp eq i32 %b, %a              ; <i1>:0 [#uses=1]
          zext i1 %0 to i32               ; <i32>:0 [#uses=1]
          ret i32 %0
  }

The type of %0 is simultaneously i1 and i32. By contrast, naming the variable %A
makes it invalid. This does not assemble

  define i32 @test2(i32 %a, i32 %b) {
  entry:
          %A = icmp eq i32 %b, %a
          %A = zext i1 %A to i32
          ret i32 %A
  }

with the error "Redefinition of value 'A' of type 'i32'" which is desired. I'd
like this C code:

  int test1(int a, int b) { return a == b; }

to produce this llvm assembly:

  define i32 @test1(i32 %a, i32 %b) {
  entry:
          icmp eq i32 %b, %a              ; <i1>:0 [#uses=1]
          zext i1 %1 to i32               ; <i32>:1 [#uses=1]
          ret i32 %1
  }



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