-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Description
| Bugzilla Link | 1021 |
| Version | trunk |
| OS | Linux |
| CC | @nlewycky |
Extended Description
While reducing a bad-generated-code bug (which I'll submit a separate report
for), bugpoint produced a reduced test case which is supposed to reproduce the
problem, but it didn't. The bug ended up being with the folding of static
initializer data into instructions that use it. The reduced test case bugpoint
produced had the static initializers removed, so it didn't exhibit the problem.
Here's the reduced test case that reproduces the orignial bug, and which
bugpoint reduces into a test case that doesn't reproduce it.
target datalayout = "e-p:32:32"
target endian = little
target pointersize = 32
target triple = "i686-pc-linux-gnu"
%fmt = constant [4 x sbyte] c"%x\0A\00"
%bytes = constant [4 x sbyte] c"\AA\BB\CC\DD"
implementation
int %main() {
%y = alloca uint
%c = cast uint* %y to sbyte*
%z = getelementptr [4 x sbyte]* %bytes, int 0, int 0
call void %llvm.memcpy.i32( sbyte* %c, sbyte* %z, uint 4, uint 1 )
%r = load uint* %y
%t = cast [4 x sbyte]* %fmt to sbyte*
%tmp = call int (sbyte*, ...)* %printf( sbyte* %t, uint %r )
ret int 0
}
declare void %llvm.memcpy.i32(sbyte*, sbyte*, uint, uint)
declare int %printf(sbyte*, ...)