Re: [llvm-commits] [127801] When an LLVM type has struct padding that overlaps with important fields of

2007-06-01 Thread Duncan Sands
Hi Chris, this breaks the Ada build since the TYPE_SIZE may not be a constant: + if (TYPE_SIZE(type) == 0 || + PadStartBits = int(TREE_INT_CST_LOW(TYPE_SIZE(type))) || I've attached a fix, which includes some other tweaks for arrays (not very important) plus whitespace

Re: [llvm-commits] [127801] When an LLVM type has struct padding that overlaps with important fields of

2007-06-01 Thread Chris Lattner
Does this actually cause a problem? This function is only called if the outer struct has constant size. TreeToLLVM::EmitAggregateCopy checks that TREE_CODE(TYPE_SIZE(type)) == INTEGER_CST is true before calling into this code. Yes, it crashes the compiler. Remember that the function is

Re: [llvm-commits] [127801] When an LLVM type has struct padding that overlaps with important fields of

2007-06-01 Thread Duncan Sands
Hi Chris, Okay, do you have a testcase that demonstrates this? I will synthesize one for you. Also, the code for handling large arrays isn't needed. This code is only called for fixed size structures that are small. Hey, you are the one who used getInt64 to get the array length! :)

Re: [llvm-commits] [127801] When an LLVM type has struct padding that overlaps with important fields of

2007-06-01 Thread Duncan Sands
Okay, do you have a testcase that demonstrates this? I will synthesize one for you. Actually a testcase would be pointless, since the compiler crashes during the (Ada) compiler build. It wouldn't be pointless if I could make a C or C++ testcase, but I don't think it can be done except in

Re: [llvm-commits] [127801] When an LLVM type has struct padding that overlaps with important fields of

2007-05-31 Thread Duncan Sands
Hi Chris, this breaks the Ada build since the TYPE_SIZE may not be a constant: + if (TYPE_SIZE(type) == 0 || + PadStartBits = int(TREE_INT_CST_LOW(TYPE_SIZE(type))) || I've attached a fix, which includes some other tweaks for arrays (not very important) plus whitespace cleanup. Ciao,

Re: [llvm-commits] [127801] When an LLVM type has struct padding that overlaps with important fields of

2007-05-31 Thread Chris Lattner
On May 31, 2007, at 6:18 AM, Duncan Sands wrote: Hi Chris, this breaks the Ada build since the TYPE_SIZE may not be a constant: + if (TYPE_SIZE(type) == 0 || + PadStartBits = int(TREE_INT_CST_LOW(TYPE_SIZE(type))) || I've attached a fix, which includes some other tweaks for arrays

[llvm-commits] [127801] When an LLVM type has struct padding that overlaps with important fields of

2007-05-29 Thread clattner
Revision: 127801 Author: clattner Date: 2007-05-29 22:38:39 -0700 (Tue, 29 May 2007) Log Message: --- When an LLVM type has struct padding that overlaps with important fields of GCC types, use memcpy to copy them instead of copying the llvm fields. This helps address PR1421,