[llvm-commits] CVS: llvm-gcc/gcc/llvm-types.c
Chris Lattner
lattner at cs.uiuc.edu
Fri Jul 29 16:14:15 PDT 2005
Changes in directory llvm-gcc/gcc:
llvm-types.c updated: 1.28 -> 1.29
---
Log message:
Fix the compiler crash on MallocBench/gs
---
Diffs of the changes: (+7 -6)
llvm-types.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
Index: llvm-gcc/gcc/llvm-types.c
diff -u llvm-gcc/gcc/llvm-types.c:1.28 llvm-gcc/gcc/llvm-types.c:1.29
--- llvm-gcc/gcc/llvm-types.c:1.28 Fri Jul 29 14:25:27 2005
+++ llvm-gcc/gcc/llvm-types.c Fri Jul 29 18:14:04 2005
@@ -119,12 +119,12 @@
if (AlignmentInited == 0) { AlignmentInited = 1; InitializeAlignments(); }
return PrimitiveAlignments[Ty->ID];
}
- case ArrayTyID:
- assert(Ty->x.Array.Alignment && "Array does not have alignment set!");
- return Ty->x.Array.Alignment;
+ case ArrayTyID:
+ //assert(Ty->x.Array.Alignment && "Array does not have alignment set!");
+ return Ty->x.Array.Alignment ? Ty->x.Array.Alignment : 4;
case StructTyID:
- assert(Ty->x.Struct.Alignment && "Struct does not have alignment set!");
- return Ty->x.Struct.Alignment;
+ //assert(Ty->x.Struct.Alignment && "Struct does not have alignment set!");
+ return Ty->x.Struct.Alignment ? Ty->x.Struct.Alignment : 4;
default:
fprintf(stderr, "ERROR: Type doesn't have size: ");
llvm_type_dump(Ty);
@@ -1449,7 +1449,8 @@
if (Field && TREE_CODE(Field) != FIELD_DECL)
Field = GetNextFieldDecl(Field);
for (fieldcount = 0; Field; fieldcount++,Field = GetNextFieldDecl(Field)) {
- assert ((fieldcount<256*4) && "LLVM can only have 1023 structure members!");
+ assert ((fieldcount<256*4) &&
+ "LLVM can only have 1023 structure members!");
DecodeFieldDecl(Field, StructElements, ElementOffsets, ElementAlignments,
&Idx, &Size);
More information about the llvm-commits
mailing list