Bug: llvm/test/Regression/CFrontend/2003-08-30-LargeIntegerBitfieldMember.c Causes crash: $ llvmgcc -c 2003-08-30-LargeIntegerBitfieldMember.c UNKNOWN INTEGRAL TYPE SIZE: 984 2003-08-30-LargeIntegerBitfieldMember.c:9: internal compiler error: in llvm_type_get_integer, at llvm-types.c:489
This bug prevents pine from compiling as "struct pine { ... }" contains something resembling this test case as a subset. Since this prevents Chris from using LLVM-pine, I'm escalating the bug to "major". :)
Dood, in that case, this has got to be fixed by 1.1!!
(finally) Fixed. Testcase: CFrontend/2003-08-30-LargeIntegerBitfieldMember.c Patch: $ diff -u llvm-types.c~ llvm-types.c --- llvm-types.c~ 2003-11-19 18:17:19.000000000 -0600 +++ llvm-types.c 2003-11-19 18:59:34.000000000 -0600 @@ -711,6 +711,23 @@ *Size = 0; } while (*Idx && *Size > StartByte); + /* Output this as a series of integer fields. */ + while (ElSize > 64) { + unsigned UnitSize = ElSize & 63; + /* Eliminate all but one bit from the size */ + if ((UnitSize & (UnitSize-1)) != 0) + UnitSize = UnitSize ^ (UnitSize & (UnitSize-1)); + + if (UnitSize == 0) UnitSize = 64; + + ElementTys[*Idx] = llvm_type_get_integer(UnitSize, 1); + ElementOffsets[*Idx] = StartByte; + ElementAlignments[*Idx] = 1; + ++*Idx; + StartByte += UnitSize/8; + ElSize -= UnitSize; + } + Ty = llvm_type_get_integer(ElSize, !HasSignedField); } -Chris