<div dir="ltr">I've been diagnosing this bug:<br><a href="http://llvm.org/bugs/show_bug.cgi?id=17827">http://llvm.org/bugs/show_bug.cgi?id=17827</a><br><br>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?<br>
<br><span style="font-family:courier new,monospace">$ cat bitfield.c</span><br><span style="font-family:courier new,monospace">/* %struct.S = type { i8, [3 x i8] } ??? */<br>struct S {<br>  int f0:3;<br>} a;<br><br>int foo (int p) {<br>
  struct S c = a;<br>  c.f0 = p & 6;<br>  return c.f0 < 1;<br>}<br><br>int main () {<br>  return foo (4);<br>}</span><br><br><br></div>