Fix and off-by-one bug in bitfield handling. Radar 7980096. (Hartnellifactation of r104523.)
llvm-svn: 104559
diff --git a/llvm-gcc-4.2/gcc/llvm-convert.cpp b/llvm-gcc-4.2/gcc/llvm-convert.cpp
index 9e91da8..142ca46 100644
--- a/llvm-gcc-4.2/gcc/llvm-convert.cpp
+++ b/llvm-gcc-4.2/gcc/llvm-convert.cpp
@@ -7293,7 +7293,7 @@
// adjust FieldPtr so that it is close enough to the bitfield that
// *FieldPtr contains the first needed bit. Be careful to make sure that
// the pointer remains appropriately aligned.
- if (BitStart > LLVMValueBitSize) {
+ if (BitStart >= LLVMValueBitSize) {
// In this case, we know that the alignment of the field is less than
// the size of the field. To get the pointer close enough, add some
// number of alignment units to the pointer.