[LLVMdev] struct with signed bitfield (PR17827)
Kay Tiong Khoo
kkhoo at perfwizard.com
Fri Nov 15 15:42:21 PST 2013
I've been diagnosing this bug:
http://llvm.org/bugs/show_bug.cgi?id=17827
Summary: I think the following program miscompiles at -O1 because the fact
that 'f0' is a signed 3-bit value is lost in the unoptimized LLVM IR. How
do we fix this?
$ cat bitfield.c
/* %struct.S = type { i8, [3 x i8] } ??? */
struct S {
int f0:3;
} a;
int foo (int p) {
struct S c = a;
c.f0 = p & 6;
return c.f0 < 1;
}
int main () {
return foo (4);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131115/88eaeac4/attachment.html>
More information about the llvm-dev
mailing list