[llvm-commits] CVS: llvm-gcc/gcc/llvm-expand.c
Chris Lattner
lattner at cs.uiuc.edu
Mon Feb 14 21:26:56 PST 2005
Changes in directory llvm-gcc/gcc:
llvm-expand.c updated: 1.80 -> 1.81
---
Log message:
When emitting bitfield offset computation code, remember that we may have
already offseted to the start of the field, so we need to subtract that out.
This fixes test/Regression/C++Frontend/2005-02-14-BitFieldOffset.cpp and
PR510: http://llvm.cs.uiuc.edu/PR510 .
---
Diffs of the changes: (+3 -2)
llvm-expand.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
Index: llvm-gcc/gcc/llvm-expand.c
diff -u llvm-gcc/gcc/llvm-expand.c:1.80 llvm-gcc/gcc/llvm-expand.c:1.81
--- llvm-gcc/gcc/llvm-expand.c:1.80 Sun Feb 13 20:53:56 2005
+++ llvm-gcc/gcc/llvm-expand.c Mon Feb 14 23:26:41 2005
@@ -5511,11 +5511,12 @@
*/
llvm_type *SBPtr = llvm_type_get_pointer(SByteTy);
llvm_value *Ptr = cast_if_type_not_equal(Fn, Result, SBPtr);
- if (Offset) {
+ if (Offset-ActualOffset) {
llvm_instruction *GEP = llvm_instruction_new(SBPtr, "tmp",
O_GetElementPtr, 2);
GEP->Operands[0] = Ptr;
- GEP->Operands[1] = llvm_constant_new_integral(IntPtrTy, Offset/8);
+ GEP->Operands[1] =
+ llvm_constant_new_integral(IntPtrTy, (Offset-ActualOffset)/8);
Ptr = append_inst(Fn, GEP);
}
Result = cast_if_type_not_equal(Fn, Ptr, Result->Ty);
More information about the llvm-commits
mailing list