[LLVMbugs] [Bug 14166] New: opt -gvn tries to do a (vector-of-)pointer-to-int cast and fails on 14-line sample

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Oct 23 19:25:29 PDT 2012


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

             Bug #: 14166
           Summary: opt -gvn tries to do a (vector-of-)pointer-to-int cast
                    and fails on 14-line sample
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: default_357-feep at yahoo.de
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


When confronted with the following source, opt -gvn tries to bitcast <2 x i8*>
to i64, which is an invalid operation.

    ; test with opt test.ll -gvn -o /dev/null
    target datalayout = "e-p:32:32:32"
    define <2 x i32> @main() {
      %1 = alloca <2 x i32>
      call void @anything(<2 x i32>* %1)
      %2 = load <2 x i32>* %1
      %3 = inttoptr <2 x i32> %2 to <2 x i8*>
      %4 = bitcast <2 x i32>* %1 to <2 x i8*>*
      store <2 x i8*> %3, <2 x i8*>* %4
      %5 = load <2 x i32>* %1
      ret <2 x i32> %5
    }
    declare void @anything(<2 x i32>*)

The following is output from opt with assertions enabled:
http://pastebin.com/S7TRswMB

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