http://llvm.org/bugs/show_bug.cgi?id=11238
Summary: suboptimal code generation in pointer comparison (this
also affects std::vector.push_back())
Product: new-bugs
Version: trunk
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: new bugs
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Test Case:
; ModuleID = 'x.ll'
target datalayout =
"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
%t = type { i32, i32 }
define i32 @main() nounwind readnone {
r1:
%x = alloca %t, align 8
%a = getelementptr %t* %x, i64 0, i32 0
%b = getelementptr %t* %x, i64 0, i32 1
%equal = icmp eq i32* %a, %b
%merge = select i1 %equal, i32 1, i32 2
ret i32 %merge
}
I think the issue should be obviously.
Have fun fixing it. This code occurs also on code generation of the C++
template std::vector:
#include <vector>
#include <iostream>
using namespace std;
int main() {
vector<int> v;
v.push_back(1);
v.push_back(2);
v.push_back(3);
for(vector<int>::iterator it = v.begin(); it < v.end(); it++) {
cout << *it << endl;
}
}
--
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs