[LLVMbugs] [Bug 4186] New: missed IR opt: eliminate unused bitcast in call

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sun May 10 14:04:58 PDT 2009


           Summary: missed IR opt: eliminate unused bitcast in call
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Scalar Optimizations
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: daniel at zuster.org
                CC: llvmbugs at cs.uiuc.edu

The bitcast below can be eliminated:
ddunbar at frank:test$ cat t.c
void f0(void) {

void f1(void);
ddunbar at frank:test$ llvm-gcc -O3 -emit-llvm -S -o - t.c
t.c:5: warning: conflicting types for ‘f1’
t.c:2: warning: previous implicit declaration of ‘f1’ was here
; ModuleID = 't.c'
target datalayout =
target triple = "i386-pc-linux-gnu"

define void @f0() nounwind {
        %0 = tail call i32 (...)* bitcast (void ()* @f1 to i32 (...)*)()
nounwind               ; <i32> [#uses=0]
        ret void

declare void @f1()

The example C code is lame, but this situation also occurs during linking.

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