[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


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

           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) {
  f1();
}

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 =
"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
target triple = "i386-pc-linux-gnu"

define void @f0() nounwind {
entry:
        %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